Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

PrintCancel – PB Docs 2022 – PowerBuilder Library

PrintCancel – PB Docs 2022

PrintCancel

PowerScript function

Description

Cancels printing and deletes the spool file, if any. Cancels
printing of a print job that you opened with the PrintOpen function. The
print job is identified by the number returned by PrintOpen.

For syntax for DataWindows and DataStores, see the PrintCancel
method for DataWindows in the section called “PrintCancel” in DataWindow Reference.

Syntax

Argument

Description

printjobnumber

The number the PrintOpen function assigned to the print
job

Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If
printjobnumber is null, PrintCancel returns null.

Usage

PrintCancel cancels the specified print job by deleting the spool
file, if any, and closing the job. Because PrintCancel closes the print
job, do not call the PrintClose function after you call
PrintCancel.

Examples

In this example, a script for a Print button opens a print job and
then opens a window with a cancel button. If the user clicks on the cancel
button, its script sets a global variable that indicates that the user
wants to cancel the job. After each printing command in the Print button’s
script, the code checks the global variable and cancels the job if its
value is true.

The definition of the global variable is:

The script for the Print button is:

The script for the cancel button in the second window is:

See also

Print

PrintClose

PrintOpen


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x