SPLOPEN
ANSI
The SPLOPEN instruction directs printed output to the disk or another specified device. Spooled disk files are written in a standard operating system format and may be printed using any compatible list utilities. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
pfile
Required. A previously defined PFILE variable.
name
Required. A previously defined Character String Variable or Literal containing the name of the spool file/device name.
options
Optional. A previously defined Character String Variable or Literal containing the SPLOPEN options.
Flags Affected: NONE
Note the following:
The {name} may contain a complete file path and name or a valid device designation, within the operating system's standards (i.e., COM1: or LPT1: in MS-DOS or /dev/tty01 in Linux.). If {name} is a string variable, only the Logical String is used.
By default there is no extension applied to the SPLOPEN file name. However, the user can set the UET keyword named PLB_SPLEXT to ON which will allow use of the screen definition extension.
If {name} is a Null String, the default file name is used (DSPORT##.SPL for MS-DOS or PORT####.??? for Linux. The pound signs (#) are replaced with the user's port number and the question marks (?) are replaced by the default extension from the screen definition file.
For PLBCMP GUI, if {name} is null and the 'Q' option is specified, the standard open file dialog is displayed. Otherwise, the standard file prep dialog is displayed. If the standard open file dialog is canceled, the standard file prep dialog is displayed.
If a hyphen (-) is specified for {name}, the settings for the last print open dialog or PAGESETUP instruction are used.
An {ip address} may be appended to the spool file {name}. This generates the file at the SUNDM data manager identified by the {ip address}. The runtime keyword (PLB_SPLUSEIP) redirects a spooled print file without changing the program. In addition, the GETMODE and SETMODE statements support the *SPLUSEIP keyword that redirects spooled files.
If running under the PL/B Application Server (PLBSERVE), the *APSPOOL SETMODE control determines whether the file or device is opened on the client or the server.
If running under the PL/B Application Server (PLBSERVE), a file name beginning with an exclamation mark (!) indicates that the spooled file or device exists at the client workstation. The exclamation mark is not part of the file name. Other runtimes such as PLBWIN ignore the leading exclamation mark and it is not part of the file name.
A Datapoint style filename of `filename/ext:drv' is converted to a Sunbelt format as follows:
If an extension is found, the '/' extension delimiter is now changed to a Sunbelt extension delimiter character defined in the screen definition file used by the runtimes. The default extension delimiter would replace the '/' delimiter with a period.
The ':drv' specification in a Datapoint filename is changed to a substituted string
defined by a UET keyword that must be defined by appending the Datapoint drive identification string to
'PLBVOL_'. In the above case the UET string must be defined as 'PLBVOL_DRV={path}' in the environment
table or in the 'PLBWIN.INI' file. If the UET keyword is not found, the runtime attempts to open the
file with no changes. However, if the UET keyword is found, the runtime changes the filename to '{path}\filename.ext'.
Example: UET has environment entry defined as PLBVOL_P=C:\PRT
SPLOPEN
"PRTFILE/PRT:P"
Actual spool file is opened as: C:\PRT\PRTFILE.PRT
{options} must be a string literal with a "Q" (in upper or lower case) as the first byte or a string variable in which the Form Pointer (FP) is set to the letter "Q" (again in upper or lower case). The "Q" designates the append mode for the file/device rather than its being overwritten. If the file does not exist when the "Q" is specified, it is created. The 'Q' option is not supported for PDF output.
For PLBCMP, the format of the spool {options} field is a list of options separated by commas. Options available in addition to "Q" are defined as follows:
|
Option |
Specifies that ... |
|
F or f |
the output is to be in PDF format. (9.6B) |
|
N or n |
the printed output is non-buffered at operating system level. This option is available for Linux and PLBCON environments. |
|
W or w |
a Window's printer device name is being supplied in {name}. This option is available for GUI environments. |
|
A or a |
a Window's printer device name is being supplied in {name}. In addition, the device is opened in a manner to allow absolute pass through mode. In this mode, data is passed to the printer device without the data being affected by the operating system. This option is available in GUI environments. |
|
R or r |
a Window's printer device name is being supplied in {name}. In addition, the device is opened in raw data output mode. This mode may be used for printer drivers that don't support the absolute pass through mode (A). This option is available in GUI environments. |
Print spooling with no {pfile} remains active across program chaining until a SPLCLOSE is executed or the program returns control to the operating system.
Print spooling with a {pfile} that is not a GLOBAL variable does not remain active across program chaining. It is also terminated when a SPLCLOSE is executed.
The spool file/device is locked from access by other PL/B programs until a SPLCLOSE is executed or control returns to the operating system.
If a FILEPI instruction is active, it is terminated.
The printer name may be retrieved following a SPLOPEN with the GETFILE instruction.
SPLOPEN detects a 'pdf:' device name and the standard file prep dialog is displayed. When the end-user selects a file name, the file is created and output to the file is written in PDF format. (9.6B)
The 'Q' option is not supported for PDF output. (9.6B)
A PFILE opened for PDF output using the SPLOPEN instruction can be used in PRTPAGE and PRTCLOSE statements. (9.6B)
If the 'SETMODE *USESPLEXT=ON' is set and the "F" mode is used for the SPLOPEN, the default extension of '.pdf' is always used for the output file. (9.6B)
See Also: Example Code, SPLCLOSE, PRTOPEN, Printer Instructions
![]() |