Files
akbasic/tests/language/housekeeping/verbs.bas
Andrew Kesterson bfac13ff87 Implement the housekeeping verbs, and stop the REPL spinning after an error
NEW, CLR, CONT, SWAP, TRON, TROFF and HELP. None is in the Go reference, so
what each means here is recorded beside it.

Testing CONT turned up a hang that predates this: the runtime's error class is
deliberately sticky, and with run_finished_mode REPL every later step
re-entered REPL and printed READY -- overwriting the QUIT that end of input
had just set. An interactive session that hit one runtime error printed READY
forever instead of exiting.

RESTORE and RENUMBER are deferred with reasons; RESTORE turns out to need a
DATA pointer this port does not have, which is a defect in its own right.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 12:07:50 -04:00

23 lines
734 B
QBasic

10 REM Group B: the housekeeping verbs. None of these is in the Go reference --
20 REM they are on its own unimplemented list -- so what each one means here is
30 REM a decision, recorded in src/runtime_housekeeping.c beside the verb.
40 A# = 1 : B# = 2
50 PRINT A# : PRINT B#
60 SWAP A#, B#
70 PRINT A# : PRINT B#
80 REM SWAP exchanges the variables, so an array goes with its dimensions.
90 DIM P#(3)
100 DIM Q#(3)
110 P#(2) = 7 : Q#(2) = 9
120 SWAP P#, Q#
130 PRINT P#(2) : PRINT Q#(2)
140 REM TRON prints each line number inline before the line runs, as a C128 does.
150 TRON
160 PRINT "TRACED"
170 TROFF
180 PRINT "NOT TRACED"
190 REM CLR drops the variables and keeps the program.
200 CLR
210 PRINT A#
220 PRINT "STILL RUNNING"