| Special File Handling |
|
| Formats | 1.
Open
Device File:
OPEN (chan[,fileopt])"*WINPRT*[;Q_name[Q_options]" 2. Open for Read-Only: OPEN INPUT (chan[,fileopt])"*WINPRT*[;Q_name[Q_options]" 3. Open for [WDX]: OPEN [INPUT] (chan[,fileopt])"[WDX]*WINPRT*[;Q_name[Q_options]" Where:
|
|||||||||||||||||||||||||||||||||||||||||||
| The *WINPRT* Keyword is not case-sensitive. Special device filename, enclosed in quotation marks within OPEN directive. (Include asterisks in syntax.) | ||||||||||||||||||||||||||||||||||||||||||||
| Description | Use *WINPRT* with your OPEN and/or OPEN INPUT directives to gain standard API access to the Windows print subsystem. For raw or pass-through mode, use *WINDEV* Raw Print Mode. | |||||||||||||||||||||||||||||||||||||||||||
| *Note* | For use in WindX or Windows only. | |||||||||||||||||||||||||||||||||||||||||||
| The
device driver for your given printer interprets the data
you send to the *WINPRT*
channel, then sends the output to the Windows spooling
subsystem for transmission to its destination. You can
identify the LPT for direct local access to the port or
use UNCs (Universal Naming Conventions) for transmissions
to a shared resource. LPT identification is not
recommended under Windows NT. ProvideX recognizes *WINPRT* as a special device file in your OPEN [INPUT] directive and deals with it internally in the language at run time. ProvideX returns an Error #12: File does not exist (or already exists) on the OPEN if no printers are installed or if the user presses the Cancel button in a printer selection dialogue. (This error can also occur if no printer is "Set As Default".) Some printer device drivers are unable to handle invalid Q_options; i.e., unknown property assignments and/or syntax errors (like range=1,5instead of the correct range=1:5). The result can be unpredictable. The driver can even cause your ProvideX session to hang during the open. If you encounter unexpected problems, invalid Q_options for the given driver are the likely cause. |
||||||||||||||||||||||||||||||||||||||||||||
| *Note* | Escape sequences are not allowed with *WINPRT* and may have an unpredictable effect on the device and/or printer driver. If you need access to the print subsystem to send PCL, escape sequences, etc., use *WINDEV* Raw Print Mode. | |||||||||||||||||||||||||||||||||||||||||||
| Format 1 | Open Device File
Use this format to open the *WINPRT* device file. ProvideX will recognize and deal with this special device file at run time to give you access to the Windows print subsystem. Then you can send print jobs to the given queue on your open channel. See *WINPRT* / *WINDEV* Printing Examples. |
|||||||||||||||||||||||||||||||||||||||||||
| *Note* | Some device drivers issue an extra blank page (some even hang) if an open channel is closed too quickly or if nothing is printed to the channel before it's closed. Use the OPEN INPUT directive (described next) to bypass problems of this nature. | |||||||||||||||||||||||||||||||||||||||||||
| Format 2 | Open for Read-Only Mode
Use the OPEN INPUT directive to open *WINPRT* in read-only mode when you only want to determine the properties (Q_options) of a printer without sending a physical job. With an OPEN INPUT directive, you can open the printer, process your queries, and close the channel without starting a physical job. Use the WINPRT_SETUP READ PROPERTIES directive, a 'FONT'(LIST) graphics mnemonic or the MXC( ) and MXL( ) functions without generating a FormFeed:
|
|||||||||||||||||||||||||||||||||||||||||||
| *Note* | The 'FONT' mnemonic works with *WINPRT*, but not with any of the text-mode printers. | |||||||||||||||||||||||||||||||||||||||||||
| Maximum
column and line values are zero-based. In the following
example, the MXC(
) value returned is 79, for 0-79 = 80 columns:
C=MXC(30)+1 ! For this
printer MXC(30) returns 79, C=80 (0-79) Your string variable in reading properties returns a printer-specific list (here, for the ASIS printer):
|
||||||||||||||||||||||||||||||||||||||||||||
| Format 3 | Open for [WDX]
On an NT or PC server, if you include [WDX] in your OPEN [INPUT] directive (e.g., OPEN (30)"[WDX]*WINPRT*"), that signals ProvideX to direct any print jobs and dialogues to the WindX client PC, which will in turn use its Windows print subsystem to send jobs to the given printer. If you are using *WINPRT* on an NT Server and do not use [WDX] in your OPEN directive, then the printer selection dialogue will appear on the server console, and any print queue you name directly must exist on the NT server in the Control Panel printers folder.
|
|||||||||||||||||||||||||||||||||||||||||||
| Reminder: | You must install and use WindX to use *WINPRT* in a UNIX environment; however, you do not need the [WDX] tag on a UNIX server because ProvideX automatically directs *WINPRT* access to your WindX client PC. | |||||||||||||||||||||||||||||||||||||||||||
| See Also | WINPRT_SETUP Directive MXC( ) / MXL( ) Functions 'FONT' Mnemonic *WINPRT* / *WINDEV* Printing Examples [WDX] Tag |
|||||||||||||||||||||||||||||||||||||||||||