PRTCLOSE


8.0.3, PLBCMP GUI Only

 

The PRTCLOSE instruction terminates printing to a Windows print device. The instruction uses the following format:

 

 

[label]

PRTCLOSE

{pfile}[,{option}[,...]]

 

Where:

label

Optional. A Program Execution Label.

pfile

Required. A previously defined PFILE variable that has been opened using a PRTOPEN or a SPLOPEN (9.6B) instruction.

option

Optional. Keywords as described below that control the print preview initial presentation state.

Flags Affected: NONE

Note the following:

  1. Any PRTPAGE instruction that is executed after execution of a PRTCLOSE instruction generates a S05 error.

  2. Any PRTCLOSE instruction that is executed against an unopened {pfile} is ignored.

  3. If a device name of "@" or "@printer name" was specified in the PRTOPEN statement, a Print Preview is performed.

  4. {option} may be one or both of the following keywords that control the initial presentation state of the Print Preview. The {value} assigned for some keywords can bea Numeric Variable or decimal number:

  5.  

    Option

    Specifies ...

    ABORT[={nvar | ivar}]

    that a user may terminate an advanced printing session without coming up into the PRINT PREVIEW window. Notice that the ABORT keyword can be specified with or without an optional parameter. When the {dnumnvar} value is specified, a non-zero value terminates the printing session while a value of zero does not terminate the printing session. In addition, note that any spooled file is deleted if a printing session is terminated. (8.7B)

    CANCELKEY={nvar | ivar}

    a numeric variable that is assigned a value of one if the print dialog was canceled. Note that an S10 error will still occur if the dialog is canceled. If the user program TRAPs the S10 error, the CANCELKEY variable value is set accordingly.

    COPYCOUNT={nvar | ivar}

    a numeric variable that identifies the current setting of the printer driver copy parameter when a printing operation was performed.

    DIALOG={value}

    whether a print dialog should be presented when a Print is selected from a Print Preview operation. When the {value} is zero, a print dialog does not appear. When the {value} is not zero, a print dialog does appear. When this option is not specified, the default action is a {value} of zero.

    ENDPAGE={value}

    the ending physical page is the last page in the Print Preview presentation. If this option is not specified, the last page defaults to the last paged generated by a PRTPAGE operation before the PRTCLOSE operation.

    GOTOPAGE={value}

    the first page presented from the print preview page set being used. The {value} should be between one and the last logical page being reviewed.

    MAXIMIZE={value}

    whether the Print Preview window starts in a maximized state. A {value} of zero (0) indicates that the window is not maximized when started. This is also the default starting state. Any non-zero {value} indicates that the window should start in a maximized state.

    PAGECOUNT={nvar | ivar}

    a numeric variable that identifies the number of pages printed. If the value returned is zero, no pages were printed. This keyword indicates whether a user printed from a Print Preview window.

    STARTPAGE={value}

    the beginning physical page is page one in the Print Preview presentation. If this option is not specified, page one defaults to the first physical page generated after the PRTOPEN operation.

    ZOOM={value}

    the initial zoomed state for the Print Preview window. {value} can be in the range of zero (0) to six (6) inclusive. If 

    the ZOOM keyword is not used or the ZOOM keyword is not provided, the zoom state is set to scale at 100%.

    The following table shows the scaling used for all of zoom values.

    Zoom Value

    Scaling percentage

    No Keyword

    100%

    0

    100%

    1

    75%

    2

    100%

    3

    125%

    4

    150%

    5

    175%

    6

    200%

     

    1. If Print Preview is not active when the PRTCLOSE instruction is executed, {option} is ignored.

    2. A PRTCLOSE can use PFILEs opened via SPLOPEN with PDF output support (9.6B).

    3. If a FILEPI instruction is active, it is terminated.

 

 

See Also: Example Code, Printer Instructions

 



PL/B Language Reference PRINT PRTOPEN