Opening a Print File

From Br Wiki
Jump to: navigation, search

A print file or printer direction is a DISPLAY FILE (see Category:File Operations). The default length for a record of a display file is 128 characters, this can be changed in the open statement to be as large as 32,000. A record written to a display file by default is right trimmed and followed by a line ending sequence that is dependent upon the operating system. For example, a Windows system will append a carriage return and a line feed. The right trim of a display file record can be overridden by setting an option (see OPTION) only if the EOL code is changed to NONE.

Opening a display file with the number 255: uses the default BR printer configuration unless other parameters are specified in the open string.

00100 open #255:"name=PRN:WORD/\\\server1\\HP4,recl=32000,eol=NONE", display,output

The above line will open a printer that utilizes the BR SPOOLCMD functionality IF SPOOLCMD has been specified in the BRCONFIG.SYS file. The string "WORD" will be passed to the spoolcommand function in the position of the PRINTQUEUE parameter, no end of line characters will be added at the end of each line, all lines will be trimmed of any space characters between the last non-space and the end of the line, no line will be wrapped unless it exceeds 32,000 characters (Note that because the EOL is set to NONE there will never be any effective line wrapping.)

1.) Opening a display file with {\b Name=WIN:/nn} does the same thing as PRN:/nn except the use of SPOOLCMD is suppressed only for that file and the print job is directed to the Windows print driver for the named printer.
2.) Opening a display file with {\b Name=DIRECT:/nn} does the same thing as PRN:/nn except the use of SPOOLCMD is suppressed only for that file and the print job is directed to port specified by the Windows print driver for the named printer without having the output processed by the print driver.

3.) Opening a display file with {\b Name=PREVIEW:/nn} does the same thing as WIN:/nn except the print output is displayed as a preview after being processed by the printer driver, but before being sent to the named printer. See NWP only print codes for acceptable escape sequences for WIN and PREVIEW (NWP) mode.

If EOL is not set to NONE and it is desired that the print file, or display file, NOT be right trimmed then the file should not be opened as a display file, but rather as an EXTERNAL file (see Category:File Operations). If using an external file and EOL should be Carriage Return and Line Feed then the record length of the external file should be set a two characters longer than the desired record length and the last two positions of each line should be written with these characters (CHR$(13)&CHR$(10)).