17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

CSRLIN Variable<br />

Purpose:<br />

To return the current line (row) position of the cursor.<br />

Syntax:<br />

y=CSRLIN<br />

Comments:<br />

y is a numeric variable receiving the value returned. The value returned is within the range of 1 to<br />

25.<br />

The CSRLIN variable returns the vertical coordinate of the cursor on the active page (see the<br />

SCREEN statement).<br />

x=POS(0) returns the column location of the cursor. The value returned is within the range of 1<br />

to 40, or 1 to 80, depending on the current screen width (see the POS function).<br />

Examples:<br />

10 Y=CSRLIN<br />

20 X=POS(0)<br />

30 LOCATE 24, 1<br />

40 PRINT "HELLO"<br />

50 LOCATE Y, X<br />

RUN<br />

HELLO<br />

The CSRLIN variable in line 10 records the current line.<br />

The POS function in line 20 records the current column.<br />

In line 40, the PRINT statement displays the comment "HELLO" on the 24 th line of the screen.<br />

The LOCATE statement in line 50 restores the position of the cursor to the original line and<br />

column.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/CSRLIN.html28/03/2004 21.29.20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!