|
PRAGMA PROGRAM REFERENCE MANUAL
|
Index
|
All Operation
|
|
Expand All ADDENDUM
|
ASSIGN COMMUNICATIONS
|
AC
|
Standard Verb
|
Input/Output Operation
|
Target =
|
Used to redirect the input/output stream to a communications port. On start- up the communications port assignement of the PRAGMA.DES file is used. With ASSIGN COMMUNICATIONS this selection can be overwritten. You can redirect the input/output stream to a valid communications port or 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.
|
ASSIGN COMMUNICATIONS to COMMUNICATIONS PORT (or FILENAME) COMMUNICATIONS PORT must be a string or a noun containing the name of the communications port. Under DOS and OS/2 "COM1", for instance. FILENAME must be a string or a noun containing a valid filename.
|
SEE ALSO: SEND / RECEIVE / ASSIGN PRINTER
|
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.
In DOS the baud rate, parity, data and stop bits for the COM port must be set with the DOS command MODE.
Example:
Under DOS, to set the communication port COM1 to a baud rate of 2400, no parity, 8 data bits and 1 stop bit you enter the following command at the DOS prompt:
mode COM1:24,n,8,1
|
|
|
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
|
|