|
![]() ![]() ![]() |
The PRINT statement outputs data to a print unit.
Format
PRINT {ON print.unit} {print.list}
where
The data is output to the requested print unit. Print unit -1 is always associated with the display and cannot be changed. Print unit 0 can be switched between the display and the printer by use of the PRINTER statement. Print units 1 to 255 direct their output to the hold file by default but can be redirected using the SETPTR command.
By using PRINT statements instead of DISPLAY in programs it is possible to select whether the output is directed to the display or to a printer. The LPTR option to the RUN command is equivalent to a PRINTER ON at the start of the program.
Use of the @(x,y) cursor movement function in a PRINT statement that sends output to the display will disable pagination. See DISPLAY for more details.
Example
N = DCOUNT(LINE, @FM) FOR I = 1 TO N PRINT ON PU LINE<I> NEXT I PAGE ON PU
This program fragment emits each field of LINE to the print unit identified by PU and then advances to a new page. |