Frequently Asked Questions - Terminal/Printers
A dL4 program accesses printers by opening a pipe to an external program, usually a batch file, and then outputting to that pipe.
Please refer to dL4 Installation & Configuration Guide for Windows 95/NT for details.
Related Article: Configuring a Printer in dL4 Windows
The CLOSE macro in the user's Terminal Definition File (TDF) can be defined to output any string of characters when dL4 exits.
Protected fields are printed in dimmed mode. If, however, the characters are already in a dark color, the driver will display the field in a bright color to contrast protected with unprotected characters. Therefore, a protected field appears in a bright color if a dark color is used in the protected field. The following sample program demonstrates how to display a protected field in bright blue in dL4 for Windows.
10 Print '255FONTCOLOR BP';"Protected Field";'EP FM', ! dimmed bright blue
20 Print '128FONTCOLOR BP';"Protected Field";'EP FM'; ! dimmed dark blue
The FONTCOLOR and the BACKCOLOR mnemonics set the foreground text and background colors, respectively. They take RGB color values to set appropriate color. The following statements provide examples for both FONTCOLOR and BACKCOLOR.
Print '0 BACKCOLOR 255FONTCOLOR' |
! black background, blue foreground |
Print '65280 FONTCOLOR 255 BACKCOLOR' |
! green foreground, blue background |
The following program sets the background and foreground borders and default colors to blue and yellow, respectively.
Open #1,{"","titl,hide",40,10} As "Window"
|
! Hidden Window |
Print #1;'255Backcolor cs ye'; |
! set border and default colors |
Channel 11,#1; |
! make window visible |
After the Channel statement, the current foreground and background colors may be changed to desired colors without affecting the border colors.
In dL4, by default, the BP/EP operations take effect only when format mode is enabled by the 'FM' mnemonic. As in IRIS, the preferred way of using protected mode is to output all protected fields with format mode off ('FX'), and then output 'FM' when finished. The FM/FX mnemonics were not mandatory in the IRIS/UniBasic environment, but their use was recommended (see IRIS R9 Business Basic Manual, p. 3-31). Many UniBasic users combined 'BP' and 'FX' mnemonics as a single 'BP' mnemonic in their term files for BITS program compatibility. Similarly, they combined 'EP' and 'FM' as a single 'EP' mnemonic in their term files. This behavior can be duplicated in dL4 for Unix by adding the line "BPIsFXBP=True" to the "[Settings]" section of the terminal description files.
A detailed description can be found in a white paper on Terminal Definition Files. You may download a copy from our Web Site by visiting our Download Center.
A Printer Definition File is similar to a Terminal Definition File and it is used for translating printer output. A detailed description can be found in a white paper on Terminal Definition Files. You may download a copy from our Web site by visiting our Download Center.
A detailed description can be found in a white paper on Terminal Definition Files. You may download a copy from our Web Site by visiting our Download Center.
A Terminal Definition File (TDF) is similar in function to a UniBasic term.xxx file. It is used to define action keys, mnemonics, function keys, and I/O translation. A detailed description can be found in a white paper on Terminal Definition Files. You may download a copy from our Web Site by visiting our Download Center.
The option "lock=true" must appear as a REM line in the printer batch file as shown below:
rem dl4opts=lock=true
The first line in the printer script must be an options line containing the option "lock=/tmp/lockfilename". For example:
# dl4opts=lock=/tmp/lpt1.kl
In general, a UniBasic printer script file may not be used as there are major differences between Unix and Windows environment.
A UniBasic printer script file may be used with dL4 for Unix. However, if a temporary file is used to prevent concurrent printing, then the first line in the script needs to be "# dl4opts=lock=/tmp/lockfilename" where "lockfilename" is a name unique to the printer script
