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$ <> ""
CsrFlag = 0
LOCATE 3, 5, CsrFlag
DO
LOOP UNTIL INKEY$ <> ""
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.