Search    
 

   
 

 
PRAGMA PROGRAM REFERENCE MANUAL
Index
All Operation

Expand All      ADDENDUM
ASSIGN PRINTER AP Standard Verb Input/Output Operation
Target =

Used to redirect the output to the printer. Upon startup the printer assigne-
ment of the PRAGMA.DES file is used. With ASSIGN PRINTER this selection can
be overwritten. You can redirect the printer output to a valid printer port
or to a file. If the file already exists data will be appended to it. If the
file does not exist it will be created. You cannot route data to a print
spooler. To do so you must use a SYSTEM CALL.

ASSIGN PRINTER to PRINTER PORT (or FILENAME)

PRINTER PORT must be a string or a noun containing the name of the printer
port. Under DOS "LPT1", under SCO UNIX "/dev/lp0", for instance.
FILENAME must be a string or a noun containing a valid filename.

SEE ALSO: SYSTEM CALL / ASSIGN COMMUNICATIONS / PRINT

ASSIGN PRINTER and ASSIGN COMMUNICATIONS allow redirection of input/output. The single parameter to these words can be any constant (numeric or string), or any noun. This is expected to be the name of the file or port which input/output will be read/written from/to. For instance, under DOS, "LPT1" could be used with ASSIGN PRINTER to cause all subsequent printing to go to the port LPT1. Under Xenix, "/dev/lp0" would cause the same to occur. Alternately, a filename may be given to cause all data to be read/written there. Whenever AP or AC is used, it first closes the current file/port, if any, and then opens the new one (if it IS a file) for append. If you want to instead start with an empty file, you may first use DOS DELETE to remove the old file if it exists.

When the system starts up, it is possible to set an initial default printer and/or communications port/file via the PRAGMA.DES file. If no such selection is made, output to printer and/or comm port will be thrown away until AP and/or AC assigns a port or file. It is also possible to select this condition by using ASSIGN PRINTER and ASSIGN COMMUNICATIONS. If you ASSIGN PRINTER to "", all subsequent printed data will be discarded.

ASSIGN PRINTER does not route any data to a printer spooler. You may print directly to a printer, if you know the port it is attached to; or you can print into a file. If you then want the printer spooler to put that file in line to be printed, you must use a SYSTEM CALL to invoke the printer spooler. The details of this SYSTEM CALL will vary from operating system to operating system. Under Xenix, the "lp" command could be used. PRAGMA automatically closes the printer and communications files prior to a SYSTEM CALL, so this is not necessary. It also reopens them when the SYSTEM CALL returns. If you wish to remove a print spool file after sending it to the spooler via a SYSTEM CALL, you must close the file (by issuing a ASSIGN PRINTER to ""), and then DOS DELETE it. However, some spoolers may get mad if you do this before they have finished printing it, so be careful. Some operating systems may have spooling built in. They may trap any output to specific ports and spool it. In this case, a SYSTEM CALL may not be necessary.

ASSIGN COMMUNICATIONS is used for the verbs SEND, RECEIVE, and all of the file commands used with the Pragma Fileserver. SEND and RECEIVE both use the same file.



 

CustomWare® is a registered trademark of CustomWare Designs, Inc. All rights reserved.
CustomWare® is a registered servicemark of CustomWare Designs, Inc.  All rights reserved.
All images and designs on this web site are copyrighted© 2021.
v t