Difference between revisions of "CSRLIN"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 36: Line 36:


{{OutputEnd}}
{{OutputEnd}}
 
:''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.
''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:''  
''See also:''  
* [[SCREEN]], [[LOCATE]], [[POS]]
* [[SCREEN]], [[LOCATE]], [[POS]]
* [[_PRINTSTRING]] (graphic print)
* [[_PRINTSTRING]] (graphic print)

Revision as of 10:41, 17 September 2011

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


== Syntax == row% = CSRLIN


Description

  • The value returned is within the range of 1 to the current number of rows in the SCREEN mode used.
  • In screen modes that support page flipping, the CSRLIN function returns the vertical coordinate of the cursor on the active page.
  • x = POS(0) returns the column location of the cursor.


Example: 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:



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page