xHarbour Reference Documentation > Command Reference |
Selects the ouput device for @...SAY commands.
SET DEVICE TO SCREEN | printer
The SET DEVICE command sends the output of @...SAY commands either to the screen, or a printer. When SET DEVICE TO PRINTER is used, no output is displayed on the screen. The @...SAY command respects the settings set by SET MARGIN.
When the output is send to the printer, an automated EJECT is performed when the current printhead row position is less than the last print row position. When such an EJECT is executed, PCol() and PRow() values are set to zero. To The SetPRC() function can then be used to initialize PCol() and PRow() with new values.
To direct the output of @...SAY to a file, use SET PRINTER TO <fileName> and SET DEVICE TO PRINTER.
See also: | @...SAY, EJECT, PCol(), PRow(), Set(), SET PRINTER, SetPrc() |
Category: | Output commands |
Source: | rtl\set.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates how to direct the output of @...SAYs // to the printer and to a file: PROCEDURE Main SET DEVICE TO PRINTER @ 2,10 SAY "Hello there" EJECT SET PRINTER TO MyOutputFile.txt SET DEVICE TO PRINTER @ 10, 10 SAY "Current file is MyOutputFile.txt" SET PRINTER TO SET DEVICE TO SCREEN RETURN
http://www.xHarbour.com