Special File Handling
*WINDEV* Raw Print Mode
   
Formats 1. Open Device File: OPEN (chan[,fileopt])"*WINDEV*[;Q_name]"
 
2. Open for Read-Only Mode: OPEN INPUT (chan[,fileopt])"*WINDEV*[;Q_name]"
 
3. Open for [WDX]: OPEN [INPUT] (chan[,fileopt])"[WDX]*WINDEV*[;Q_name]"
 
Where:
 
  chan Channel or logical file number; e.g., OPEN (1)"*windev*"
   
  fileopt File options. Supported options for opening *WINDEV* include:
    ERR=stmtref Error transfer.
OPT=char$ File open options. See About File OPEN Options. To obtain the current OPT= value, use the OPT( ) Function.
   
  Q_name Print queue to open. (If you omit the queue name, a printer selection dialogue appears at run time to let the user select the printer and its properties.) Valid Q_name options include:
• OS name of an existing physical print queue on the local Windows machine; e.g., open(14)"*WINDEV*;HP LaserJet".
   
    • OS name of print queue ON resource (UNC, format: ON
    \\machine\resource for any shared resource or ON lpt# for direct local access to a port): OPEN(14)"*WINDEV*;HPLaserJetON\\Main_Server\P Laser" OPEN(14)"*WINDEV*;LP ON LPT1"
   
    • One of the following queue selection keywords:
    ASIS Most recently selected printer and properties.
    DEFAULT Printer currently "Set As Default" in the system; e.g.,
    OPEN (30,ERR=9900)"*WINDEV*;DEFAULT". NORMAL Normal dialogue with page range (no paper size, source tray). SETUP Setup dialogue with paper size, source tray (no page range). The Q_name is optional. *WINDEV* doesn't support setting queue options (graphical printer properties in the Windows Printer Dialogue Box such as: orientation=landscape;copies=3). See also
    *WINPRT* / *WINDEV* Queues.
   
  [WDX] *WINDEV* is specific to Windows operating systems. Under UNIX, ProvideX automatically directs *WINDEV* access to the WindX client; e.g., OPEN (14)"*windev*" !For the PC client from UNIX host. In a Windows NT environment, the *WINDEV* printer is opened relative to the host unless you prefix the printer name with [WDX]; e.g.,
OPEN (14)"*windev*" !For the NT host
OPEN (14)"[WDX]*windev*" !For the NT PC client
   
*WINDEV* Keyword, not case-sensitive. Special device filename, enclosed in quotation marks within OPEN directive. (Include asterisks in syntax.)
   
Description Use *WINDEV* with your OPEN and/or OPEN INPUT directives to gain access to the Windows print subsystem in raw or pass-through mode. For standard API access, use *WINPRT* Windows Printing.


*Note* For use in WindX or Windows only.


  You can identify the LPT for direct local access to the port or use UNCs (Universal Naming Conventions) for transmissions to a shared resource. For both LPT and UNC use, note that you can use raw escape sequences but graphical printing is not supported. LPT identification is not recommended under Windows NT.
Normally, you can take advantage of *WINDEV* to send data to the printer without having the driver strip out escape codes (for instance, to pass PCL code to the printer). That is, you can use escape sequences with *WINDEV*, but these must be both valid and supported by your given printer and print driver.
ProvideX recognizes *WINDEV* 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".)
 
Raw Printing Behaviour
ProvideX supports raw mode to send raw data to a Windows printer. You can control raw printing mode using the'RP' System Parameter. This parameter's default is ON. When you turn it OFF, ProvideX uses the old pass through mode.
The printer drivers shouldn't (but might) strip escape sequences from the data you send to *WINDEV*. Support for raw mode is printer and driver-dependent. Some drivers can destroy certain escape sequences (removing them from the data stream). If escape sequences disappear from your *WINDEV* print jobs, check the sequences for validity and check printer/driver appetites with their manufacturers.
   
Format 1 Open Device File
 
OPEN (chan[,fileopt])"*WINDEV*[;Q_name]"
Use this format to open the *WINDEV* device file to pass print jobs through in raw mode 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
 
OPEN INPUT (chan[,fileopt])"*WINDEV*[;Q_name]"
Use the OPEN INPUT directive to open *WINDEV* in read-only mode when you only want to determine the name and properties of a printer without sending a physical job. With an OPEN INPUT directive, you can open the printer, query the printer's properties, and close the channel without starting a physical job.
 
Example:
 
Use the WINPRT_SETUP READ PROPERTIES directive or MXC( ) and MXL( )
functions without generating a FormFeed:
 
IF WDX%<>$00$ THEN OPEN INPUT (30)"*WINDEV*;ASIS"
C=MXC(30)+1!Zero-based. For this printer MXC(30)=79, C=80 (0-79 columns) L=MXL(30)+1 ! Also zero-based.
WINPRT_SETUP READ PROPERTIES WHAT_PROP$
!WHAT_PROP$returnsprinter-specificlist(itemssuchasCOPIES=1,OFFSET=0:0)


*Note* The 'FONT' mnemonic works with *WINPRT*, but not with any of the text-mode printers. To control fonts on a text mode device, send raw escape sequences to the printer using *WINDEV*, UNC (Universal Naming Conventions), or direct access to LPT ports. Your choice of fonts via *WINDEV*, UNC, or LPT is limited to the fonts supported by the given printer.


   
Format 3 Open for [WDX]
 
OPEN [INPUT] (chan[,fileopt])"[WDX]*WINDEV*[;Q_name]"
On an NT or PC server, if you include [WDX] in your OPEN [INPUT] directive (e.g., OPEN (30)"[WDX]*WINDEV*"), then 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 *WINDEV* 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 *WINDEV* in a UNIX environment; however, you do not need the [WDX] tag on a UNIX server because ProvideX automatically directs *WINDEV* access to your WindX client PC.
   
See Also WINPRT_SETUP Directive
MXC( ) / MXL( ) Functions
*WINPRT* / *WINDEV* Printing Examples
[WDX] Tag