Sharp CALLISTO V2 (serv.man5) User Manual / Operation Manual ▷ View online
Business I.T. Systems Ltd
Example 5
var
dvCost,dvPossibleBalance : Currency ;
dvMsg : String;
procedure Process ;
begin
DebugMode(DEBUG_OFF);
dvCost,dvPossibleBalance : Currency ;
dvMsg : String;
procedure Process ;
begin
DebugMode(DEBUG_OFF);
//sets debug mode to default
Job.UpdateCount;
// Populates job information object
//Calculate cost of Job
dvCost := Queue1.Cost * Job.PageCount * Job.CopyCount;
//Calculates User’s balance
dvPossibleBalance := User.CurrentBalance - dvCost;
//Message to be sent to User informing them of cost of job
dvMsg := 'The Cost of this print job is ' + CurrToStrF(dvCost, ffCurrency, 2) +
'. This will leave you with a balance of ' + CurrToStrF(dvPossibleBalance, ffCurrency, 2) +
'. Would you like to proceed with the printing of this job ?';
'. This will leave you with a balance of ' + CurrToStrF(dvPossibleBalance, ffCurrency, 2) +
'. Would you like to proceed with the printing of this job ?';
//Checks if user has enough balance to print
if ( User.CanPrint ( queue1.cost ) = true ) then
begin
begin
// Send pop-up message to user to ask if they would like to print
if ( SendYesNoPopup ( 'Callisto Message' , dvMsg ) = 'YES' )
then
begin
then
begin
//If users reply is yes then print job
Queue1.print;
Job.Complete;
end
else
begin
Job.Complete;
end
else
begin
//if no then cancel job
Job.Cancel('Job Cancelled by User');
end;
end
else
begin
end;
end
else
begin
//Send message to user to inform them they don’t have enough credit to print job
SendTextPopup ( 'Callisto Message', 'You do not have enough credit to print the job - '+
job.DocumentName+ ' It has been cancelled');
job.DocumentName+ ' It has been cancelled');
//Cancels job
Job.Cancel('User does not have enough credit to print job');
end;
end;
end;
end;
Introduction To Callisto Scripting.doc
Page 29
Business I.T. Systems Ltd
This script first calculates the cost of printing the print. Then it calculates the User’s
balance if they decide to print this job. A Pop-up message is sent to the User showing
them the cost of the job and their balance after printing. It asks the User if they would
like to print this job. If the User agrees, the Job is printed, otherwise the Job is
cancelled.
balance if they decide to print this job. A Pop-up message is sent to the User showing
them the cost of the job and their balance after printing. It asks the User if they would
like to print this job. If the User agrees, the Job is printed, otherwise the Job is
cancelled.
Introduction To Callisto Scripting.doc
Page 30
Business I.T. Systems Ltd
Example 6
var
LastJob : boolean;
procedure Process ;
begin
DebugMode(DEBUG_OFF);
Job.updatecount;
LastJob : boolean;
procedure Process ;
begin
DebugMode(DEBUG_OFF);
Job.updatecount;
//check to see if job is last job in Queue
if Job.Position = GetJobCount then
LastJob := true
else
LastJob := false;
LastJob := true
else
LastJob := false;
//check string list for username.
if GetString('UserName1') = '' then
begin
begin
//if User Name not in list then stores username in string
StoreString('UserName1',Job.UserName);
if Queue1.isOnline = true then
begin
if Queue1.isOnline = true then
begin
// if Queue 1 is Online then stores which queue where document is printed to
if (GetString('LastQueue') <> 'Queue1') then
begin
StoreString('LastQueue','Queue1');
end;
begin
StoreString('LastQueue','Queue1');
end;
//prints separator page to Queue 1
Queue1.PrintSeparator('seperator.ps');
end
else if Queue2.isOnline = true then
begin
end
else if Queue2.isOnline = true then
begin
// if Queue 2 is Online then stores which queue document is printed to
if (GetString('LastQueue') <> 'Queue2') then
begin
StoreString('LastQueue','Queue2');
end;
begin
StoreString('LastQueue','Queue2');
end;
//prints separator page to Queue 2
Queue2.PrintSeparator('seperator.ps');
end;
end;
end;
end;
Introduction To Callisto Scripting.doc
Page 31
Business I.T. Systems Ltd
Example 6 Continued……
//if username is already in string list then print job
if GetString('UserName1') = Job.UserName then
begin
Job.UpdateCount;
if Queue1.isOnline = true then
begin
begin
Job.UpdateCount;
if Queue1.isOnline = true then
begin
//if previously printed to alternative queue then store string and print separator page
if (GetString('LastQueue') <> 'Queue1') then
begin
StoreString('LastQueue','Queue1');
Queue1.PrintSeparator('seperator.ps');
end;
begin
StoreString('LastQueue','Queue1');
Queue1.PrintSeparator('seperator.ps');
end;
//prints original job
Queue1.Print;
Job.Complete;
end
else if Queue2.isOnline = true then
begin
Job.Complete;
end
else if Queue2.isOnline = true then
begin
//if previously printed to alternative queue then store string and print separator page
if (GetString('LastQueue') <> 'Queue2') then
begin
StoreString('LastQueue','Queue2');
Queue2.PrintSeparator('seperator.ps');
end;
//prints job
Queue2.Print;
Job.Complete;
end;
end;
Job.Complete;
end;
end;
//if last job in input is reached then clear string list that holds jobs
if LastJob = true then
StoreString('UserName1','');
end;
StoreString('UserName1','');
end;
Introduction To Callisto Scripting.doc
Page 32
Click on the first or last page to see other CALLISTO V2 (serv.man5) service manuals if exist.