ProvideX V8.20 > Language Reference > 3. System Functions
389
@X( ) / @Y( ) Functions
             Convert X/Y Coordinates
Formats
1. Return Column Position: @X(col[,chan][,ERR=stmtref])
2. Return Line Position: @Y(line[,chan][,ERR=stmtref])
Where:
chan
Channel or logical file number of the device or file.
col,line
Standard print positions. Numeric expressions. Column & line numbers.
stmtref
Program line number or label to transfer control to.
Returns
Integers (x-axis coordinate for column and y-axis coordinate for line, in graphical
units ­ similar to pixels).
Description
Use these functions to convert column and line number addresses for graphics
output into x- and y-axis coordinates in graphical units (similar to pixels). The values
returned are integers. In the example below, the functions return 16 graphical units
as the coordinate for column 1 and 60 for line 2:
->0010 LET A=1, B=2
-:0020 PRINT @X(A),@Y(B)
-:RUN
16 60
These functions take the column/line numbers and, based on your given channel,
return the corresponding graphics coordinates. Numeric variables, fractions and
negative numbers are allowed as column and line values.
If you do not include a channel, the default is 0 zero, the terminal/console. If you use
either of these functions in a print statement, the output will go to the channel or
logical file number you specify in the PRINT directive; i.e., to a terminal, file or
printer.
Examples
1010 PRINT @(5,5),"CUSTOMER LISTING",
1020 PRINT 'FILL'(0,0),'RECTANGLE'(@X(4),@Y(5),@X(22),@Y(6)),
When the example above is RUN, the words "CUSTOMER LISTING" are displayed on
the screen, outlined by a rectangle. The @X(col) values start the rectangle at the
graphical equivalent of column 4 (one column before the text) and end it one column
after the text. The @Y(line) values are equivalent to lines 5 and 6, and they define the
rectangle as 1 line high starting at the top of line 5.