QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The CSRLIN function returns the current text row position of the PRINT cursor.

Syntax

row% = CSRLIN

Description

Example(s)

A semicolon stops the print cursor immediately after the print.


LOCATE 5, 5: PRINT "HELLO ";
Y = CSRLIN 'save the row
X = POS(0) 'save the column  
LOCATE 10, 10: PRINT "WORLD"
LOCATE Y, X 'restore saved position
PRINT "GOODBYE" 


         HELLO GOODBYE

         WORLD


Explanation: “HELLO “ is printed and the semicolon stops the cursor immediately after the text. The CSRLIN variable records the current print cursor’s text row in Y. The POS function records the current print cursor’s text column in X. The second PRINT statement displays the comment “WORLD” on the 10th line of the screen. The last LOCATE statement restores the position of the cursor to the original line and column immediately after the first print.

See Also