Skip to content

Commit 23be40f

Browse files
committed
examples: cursor_toggle_demo.bas (transpiler-clean CURSOR ON/OFF demo)
1 parent c651b18 commit 23be40f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

examples/cursor_toggle_demo.bas

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
' CURSOR ON / CURSOR OFF demo — transpiler-clean (FUNCTION/DO-LOOP subset).
2+
'
3+
' CURSOR OFF hides the text input caret; CURSOR ON restores it. The C
4+
' transpiler now emits plat_cursor(0|1), which each adapter maps to its native
5+
' mechanism (cc65 cursor(), ncurses curs_set, ST VT52 ESC e/f, MSX CSRSW) or
6+
' no-ops where the target shows no caret. Runs the same under the interpreter,
7+
' which toggles the terminal's ANSI show/hide cursor.
8+
'
9+
' Structured (no GOTO) so `rgcx emit-c` / `rgcx build` accept it.
10+
11+
CLS
12+
CURSOR OFF
13+
PRINT "CURSOR HIDDEN. PRESS ANY KEY."
14+
15+
K$ = ""
16+
DO
17+
GET K$
18+
LOOP UNTIL K$ <> ""
19+
20+
CURSOR ON
21+
PRINT "CURSOR SHOWN AGAIN. BYE."

0 commit comments

Comments
 (0)