BASIC Text Cursor Statements and Functions - fvdhoef/aquarius-plus GitHub Wiki
TYPE: Extended BASIC screen statement
FORMAT: LOCATE column , row
Action: Moves the cursor to the specified spot on the screen.
-
column specifies the horizontal position of the new cursor location.
-
Illegal quantity error
results if column is less than1
or greater than39
(40-column screen) or79
(80-coumn screen).
-
-
row specifies the relative vertical position of the new cursor location.
- Relative rows start at the second physical line of the text screen (the first line is reserved).
-
Illegal quantity error
results if row is less than0
or greater than23
.
Examples
LOCATE 1,1:print"Hello" `
Prints
Hello
at top left of screen.
CLS:LOCATE 19,11:PRINT"&"
Clears the screen and prints
&
in the middle of the screen.
TYPE: plusBASIC v0.26 screen function
FORMAT: CURSOROFFSET
Action: Returns the offset in Screen RAM corresponding to the position of the cursor in the active text screen.
- Returns a number in the range 41 through 999 for a 40-column screen, and 41 through 1999 for the 80-column screen.
- This is the same number used in a corresponding
POKE SCREEN
andPOKE COLOR
statement orPEEK SCREEN
andPEEK COLOR
function.
Advanced
`CURSOROFFSET` returns the value in the system variable `CURRAM` minus the starting address of Screen RAM.Examples
LOCATE 7,9:PRINT CURSOR OFFSET
Prints
407
at relative line 9 and column 7 of the text screen.
TYPE: _plusBASIC screen function
FORMAT: CURSORX
Action: Returns the column number of the cursor in the active text screen.
- Returns a number in the range 1 through 39 for a 40-column screen, and 1 through 79 for the 80-column screen.
Advanced
The returned column number is calculated from value in the system variable `CURRAM`.Examples
LOCATE 9,11:PRINT CURSORX
Prints
9
at relative line 11 and column 9 of the text screen.
TYPE: plusBASIC v0.26 screen function
FORMAT: CURSORY
Action: Returns the absolute line number of the cursor in the active text screen.
- Returns a number in the range 0 through 24.
- The number returned is equal to the a corresponding
LOCATE
statement row operand plus 1.
Advanced
The returned column number is calculated from value in the system variable `CURRAM`.Examples
LOCATE 5,13:PRINT CURSORY
Prints
14
at relative line 13 and column 5 of the text screen.
TYPE: BASIC function
FORMAT: POS(arg)
Action: Returns the horizontal position of the cursor in the current line.
- arg is dummy value.
Note: arg should always be 0. Other values are reserved for updated features.
Advanced
`POS` returns the value in the system variable `TTYPOS`Examples
PRINT "abc";POS(0)
Prints
abc 3
at the beginning of a line.
TYPE: plusBASIC screen function
FORMAT: CLEAR CURSOR
Action: Temporarily removes the cursor from the current text screen.
- The cursor is replaced by the character underneath it in the text screen.
- The cursor is restored when a
PRINT
orINPUT
statement is executed or upon return to direct mode. -
POKE SCREEN
andPOKE COLOR
do not restore the cursor.
Examples
CLEAR CURSOR:POKE SCREEN 41,"Foo":PAUSE
Hides the cursor and displays the text
Foo
at column 1 and absolute row 1.
TYPE: plusBASIC screen function
FORMAT: SET CURSOR state
Action: Enables or disables display of the cursor.
-
state is either
OFF
to disable orON
to enable the cursor display.-
Syntax error
results if state is not one of the above values.
-
- The cursor is reenabled when an
INPUT
statement is executed or upon return to direct mode. -
PRINT
,POKE SCREEN
, andPOKE COLOR
do not restore the cursor.