| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the row position of the print head.
PRow() --> nRow
The function returns a numeric value indicating the current row position of the print head.
PRow() reports the current row position of the print head when console output is directed to the printer after SET DEVICE TO PRINTER or SET PRINTER ON is issued. During printer output, PRow() maintains an internal counter which is initialized with zero. The counter is incremented by 1 when output begins in a new line, and reset to zero with the EJECT command.
The function does not increment the counter for printer control characters that advance the print head to a new line, like line feed (Chr(10)) or form feed (Chr(12)). If such a control character is sent to the printer, the current print head position must be programmatically adjusted with the SetPrc() function.
| See also: | ?|??, @...SAY, Col(), EJECT, IsPrinter(), PadC() | PadL() | PadR(), PCol(), QOut() | QQOut(), Row(), SET DEVICE, SET PRINTER, SetPrc() |
| Category: | Environment functions |
| Source: | rtl\console.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// This example prints address labels using PRow() and SetPrc()
PROCEDURE Main
USE Customer
INDEX ON Upper(Lastname) TO Cust01
SET DEVICE TO PRINTER
SetPrc( 2, 0 )
DO WHILE .NOT. Eof()
@ PRow()+1 , 0 SAY Trim( FIELD->Firstname )
@ PRow() , PCol()+1 SAY Trim( FIELD->Lastname )
@ PRow()+1 , 0 SAY Trim( FIELD->Street )
@ PRow()+1 , 0 SAY Trim( FIELD->City )
@ PRow()+1 , 0 SAY Trim( FIELD->State )
@ PRow() , PCol()+1 SAY FIELD->Zip
@ PRow()+1 , 0 SAY ""
SKIP
SetPrc( 2, 0 )
ENDDO
SET DEVICE TO SCREEN
CLOSE ALL
RETURN
http://www.xHarbour.com