xHarbour Reference Documentation > Function Reference |
Changes the PRow() and PCol() values.
SetPrc( <nRow>, <nCol> ) --> NIL
The return value is always NIL.
SetPrc() is used to programmatically set the return values of functions PRow() and PCol(). Both functions maintain internal counters for monitoring the print head position in console applications when output is directed to the printer, either with SET PRINTER or SET DEVICE.
The PCol() value is incremented with every character sent to the printer. If a character string contains non printable characters or printer control codes, the physical print head does not change its position on paper while the internal counter is incremented. In this situation, the internal counter gets out of sync with the actual print head position. The internal counter must then be manually adjusted using SetPrc().
When print output is accomplished using @...SAY, SetPrc() is required to reset PRow() if the new row position is smaller than PRow(). Otherwise, an automatic page eject occurs.
See also: | PCol(), PRow(), SET DEVICE, Set() |
Category: | Environment functions |
Source: | rtl\console.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example implements a user-defined function that sends non-printable // characters, or printer control characters, to the printer. The current // PRow() and PCol() values are saved before characters are sent, and then // restored using SetPrc(). FUNCTION PrintCtrlCode( cCtrlCode ) LOCAL lPrint := Set( _SET_PRINTER, .T. ) LOCAL nRow := PRow() LOCAL nCol := PCol() ?? cCtrlCode Set( _SET_PRINTER, lPrint ) RETURN SetPrc( nRow, nCol )
http://www.xHarbour.com