Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cursor details

Status
Not open for further replies.

pebe

Technical User
Mar 20, 2001
103
GB
CRSLIN and POS can be used to identify the cursor position. Is there any way to define its on/off status for future recovery?
 
It's a little hard to find but it's part of the LOCATE command.

LOCATE 3, 5, 1, 0, 1

3,5 - cursor position,
1 - show the cursor
0,1 - show the "underline" type cursor

LOCATE 3, 5, 1, 0, 31 shows a "block" type cursor

LOCATE 3, 5, 0 turns the cursor off

I've used this in programs where I want the user to be able to edit text and want to distinguish between "insert" and "overwrite" modes.

One way to keep track of whether it's on or off is to use a variable. For example

CsrFlag = 1
LOCATE 3, 5, CsrFlag, 0, 31
DO
LOOP UNTIL INKEY$ <> &quot;&quot;
CsrFlag = 0
LOCATE 3, 5, CsrFlag
DO
LOOP UNTIL INKEY$ <> &quot;&quot;
END

I'd have thought that the first figure that defines the cursor size might define what scanline the cursor starts at, but it doesn't. The cursor always starts at the bottom of the character baseline. You can change the height of the block cursor, LOCATE 3,5,1,0,15 is about half the size of LOCATE 3,5,1,0,31.

Ray
 
Thanks brisray,

It's so obvious when you think about it! I've always used 0 or 1 - never thought of using a variable.

Old age creeps on!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top