Contains the current vertical position of the cursor.
contains the current vertical position of the cursor. As characters are written to a device, InterSystems IRIS updates $Y
to reflect the vertical cursor position.
Each line feed (newline) character (ASCII 10) that is output increments $Y
by 1. A form feed character (ASCII 12) resets $Y
is a 16-bit unsigned integer. $Y
wraps to 0 when its value reaches 65536. In other words, if $Y
is 65535, the next output character resets it to 0.
You can use the SET
command to give a value to $X
. For example, you may use special escape sequences that alter the physical cursor position without updating the $X
values. In this case, use SET
to assign the correct values to $X
after you use the escape sequences.
The following table shows the effects of different characters on $Y
||Effect on $Y
|Any printable ASCII character
The S(ecret) protocol of the OPEN
commands turns off echoing. It also prevents $Y
from being changed during input, so it indicates the true cursor position.
Because WRITE *
does not change $Y
, you can send a control sequence to your terminal and $Y
will still reflect the true cursor position. Since some control sequences do move the cursor, you can use the SET
command to set $Y
directly. For example, the following commands move the cursor to column 20 and line 10 on a VT100-type terminal and set $X
ANSI standard control sequences (such as escape sequences) that the device acts on but does not output can produce a discrepancy between the $X
values and the true cursor position. To avoid this problem, use the WRITE *
statement and specify the ASCII value of each character in the string. For example, instead of using the following code:
use this equivalent form:
As a rule, after any escape sequence that explicitly moves the cursor, you should update $X
to reflect the actual cursor position.
Content Date/Time: 2019-06-18 10:52:35