Implement EDIT statement and ON TIMER/ON KEY event trapping, update to v0.9.0
Add event-driven programming: ON TIMER(n) GOSUB with TIMER ON/OFF/STOP, ON KEY(n) GOSUB with KEY(n) ON/OFF/STOP for F1-F10. Fix F-key escape sequence parser (F9/F10 detection, push back consumed bytes on unmatched sequences). Add EDIT statement for TUI line editing. Guard key trap polling so keystrokes aren't consumed when no traps are configured.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
10 REM ON TIMER event trapping test
|
||||
20 COUNT = 0
|
||||
30 ON TIMER(1) GOSUB 100
|
||||
40 TIMER ON
|
||||
50 T0 = TIMER
|
||||
60 IF TIMER - T0 < 3 THEN 60
|
||||
70 TIMER OFF
|
||||
80 PRINT "Timer fired"; COUNT; "times"
|
||||
90 IF COUNT >= 2 THEN PRINT "PASS" ELSE PRINT "FAIL"
|
||||
95 END
|
||||
100 COUNT = COUNT + 1
|
||||
110 RETURN
|
||||
Reference in New Issue
Block a user