Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileCRSCOL CRSLIN POS(x) TAB(n) HTAB column VTAB line n, column, line: iexp x: aexp This group of commands serve to return the location of the cursor, or to place the cursor at a particular position. CRSCOL returns the current column (X) position of the cursor. CRSLIN returns the current line (Y) position of the cursor. POS() returns the number of characters displayed on the screen (ANDed with 255 to give a maximum of 255) since the last Carriage Return. The expression x is ignored. The value returned by POS() may, however, not agree with CRSCOL e.g. if a string 120 characters long is displayed, POS(0) in this case will return the value 120, where as CRSCOL will return 41, the column number of the next character to be printed counting from the left edge. With the output of control characters POS() has even less to do with the current cursor column reported by CRSCOL, since POS() will keep track of non-printed characters, e.g. ESCape=CHR$(27). POS() will, however, ignore Line Feeds=CHR$(10), be reduced by one by the printing of a Backspace=CHR$(8), or be reset to zero by a Carriage Return=CHR$(13). TAB(n) prints spaces until POS() reaches n. If POS() already exceeds n, then a Carriage Return/Line Feed is executed first. The value of n is limited to a maximum of 255 by ANDing it internally with 255. The instruction HTAB positions the cursor to the specified column (X). The instruction VTAB positions the cursor to the specified line (Y). Note: The cursor columns and lines are counted from 1, and not 0. Examples: PRINT AT(3,12);"Test"; PRINT CRSCOL'CRSLIN PRINT TAB(37);"Test"; PRINT POS(0) INP(2) --> On the screen, 'Test7 12' appears and, underneath it, 'Test41'. (POS() returns 41, and not 42, as it is counted from zero rather than 1 as with CRSCOL). PRINT AT(4,3);"Word 1" HTAB 4 VTAB 2 PRINT "Word 2" --> 'Word 1' appears starting at line 3, column 1, and 'Word 2' at line 2, column 4. Memo: CRSCOL/CRSLIN are actually Line-A variables. Internally HTAB/VTAB call CRSCOL/CRSLIN. CRSCOL/CRSLIN -> V_CUR_XY (Line-A variables) Line-A Variable Table+, vq_curaddress()+, vs_curaddress()+