CURSOR


CURSOR({integer_expression}[,integer_expression])
       {direction}

Where

integer expression is an integer expression.

direction is a string constant taken from the following list: UP, DOWN, LEFT, RIGHT. You can use uppercase or lowercase letters. You must enclose the string constant in single or double quotation marks.

Function

The CURSOR statement positions the cursor at an absolute screen location or moves the cursor up, down, left, or right relative to its current location. This statement has no effect for nondisplay terminals.

If you specify a single integer expression, the argument is interpreted as an absolute screen offset (offset zero is the first screen position).

If you specify two integer expressions, the first is interpreted as an absolute row number and the second as an absolute column number (row 1, column 1 is the first position on the screen).

Valid row and column designations must be from 1 to 255. Valid offset designations must be from 0 to 32766.

If you specify a direction (“UP”, “DOWN”, “LEFT”, or “RIGHT”), the cursor will be moved in the indicated direction. If you specify an integer expression as a second argument, the cursor will be moved that number of spaces. If you do not specify a second argument, the cursor will be moved one space.

Examples

cursor(1,1)              /* Position the cursor at row 1,    */
                         /* column 1.                        */
cursor(1000)             /* Position the cursor at offset    */
                         /* 1000 on the screen.              */
row_number = 12
cursor(row_number,1)     /* Position the cursor at row 12,   */
                         /* column 1.                        */
cursor("up")             /* Move the cursor up one row.      */
count = 20
cursor("left",count+1)   /* Move the cursor left 21 columns. */

Note

For display terminals with multiple partitions defined, the CURSOR statement moves the cursor within the currently active partition. When a row and column are specified, however, the cursor is moved to that location on the entire screen (not just within the currently active partition). The partition that owns the area of the display where the cursor was moved becomes the currently active partition.