xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DevPos()

Moves the cursor or printhead to a row and column coordinate

Syntax

DevPos( <nRow>, <nCol> ) --> NIL

Arguments

@ <nRow>, <nCol>
The parameters are numeric values specifying the row and column coordinates for output. The range for rows on the screen is 0 to MaxRow(), and for columns it is 0 to MaxCol(). The coordinate 0,0 is the upper left corner of the screen.

When SET DEVICE TO PRINTER is active, the largest coordinate for both, row and column, is 32766.

Return

The return value is always NIL.

Description

The DevPos() function accepts numeric row and column coordinates and positions the screen cursor or printhead accordingly. Coordinates begin at point 0, 0 which is the upper left corner of the screen, or paper.

When SET DEVICE is set to SCREEN, DevPos() moves the screen cursor to the specified coordinates and updates Row() and Col().

If the current device is the PRINTER, DevPos() moves the printhead to the new row and column coordinate, taking any SET MARGIN setting into account. In addition, the current printhead position as reported by PRow() and PCol() is considered. That is, if <nRow> id smaller than PRow(), a formfeed (Chr(12)) is sent to the printer causing the printhead be positioned on a new page. If <nCol> is smaller than PCol(), the printhead is positioned on a new line.

Notes:  use SetPrc() to adjust the internal counters of PRow() and PCol() if required.

When printer output is redirected to a file, DevPos() output is recorded in that file.

Info

See also:@...SAY, Col(), DevOut(), PCol(), PRow(), QOut() | QQOut(), ROW(), SET DEVICE, SetPos(), SetPrc()
Category: Output functions
Source:rtl\console.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe