| PRINTCHAR | Index Level | PRINTER CLOSE |
| Syntax | PRINTER [ON | OFF | CLOSE | num.expression] |
| Category | BASIC |
| Type | Statement |
| Description |
controls the output from subsequent "print", "heading", "footing" or "page" statements.
"printer on" directs output to the system printer, via the Spooler. "printer off" directs output from subsequent "print" statements to the terminal. "printer close" indicates that the current (printer) output is completed. This closes all open Spooler entries generated by the current process, and releases control of the print job(s) to the Spooler. "printer close" is implicit when the FlashBASIC program stops and returns to TCL, or the calling PROC or executing program. "num.expression" evaluates as follows: -1 "printer close" 0 "printer off" >=1 "printer on" See the "crt" statement for directing output to the terminal while "printer on" is in effect. |
| Options | |
| See Also | statements & functions CRT PAGE PRINT ON PRINTER ON PRINT u0193 u3193 u61bc PRINTER CLOSE u4193 FOOTING HEADING PRINTER OFF |
| Example |
print 'press <return> to begin printing'
printer on print 'this is the first line' The first string is displayed, print output is turned on, and the second string is Sent to the spooler. crt 'print? ':;input answer printer (answer='y') The printer is turned on if the variable "answer" is the letter "y". printer on print rec<5> if rec<6>='' then printer off print 'error in attribute 6' print 'press <return> to continue ': input continue printer on end This section of program turns off the printer to display an error message and prompt for operator intervension. When the printer is turned back on, output is appended to the currently open spooler file. 10 * print 'do you want to print? ': input ans if ans # 'y' then stop printer on print 'the amount is ':amount print ... .... printer close printer off goto 10 In this example, a single section of a larger program sends output to the Spooler, closes the job when finished, and continues execution of the program. |
| Warnings | |
| Compatibility | D3 7.0 R83 AP |
| PRINTCHAR | Index Level | PRINTER CLOSE |