mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-13 06:26:05 +09:00
basic: ON statement, DO with GOTO at the end will work now
This commit is contained in:
15
assets/onlabeltest.bas
Normal file
15
assets/onlabeltest.bas
Normal file
@@ -0,0 +1,15 @@
|
||||
1 OPTIONBASE 1
|
||||
2 GOTO STARTPOINT
|
||||
100 LABEL PRINTA
|
||||
110 PRINT "A"
|
||||
120 RETURN
|
||||
200 LABEL PRINTB
|
||||
210 PRINT "B":PRINT "B"
|
||||
220 RETURN
|
||||
300 LABEL PRINTC
|
||||
310 PRINT "C":PRINT 2+2
|
||||
320 RETURN
|
||||
1000 INPUT K:LABEL STARTPOINT
|
||||
1001 IF K>3 OR K<1 THEN DO(PRINT "INPUT MUST BE 1,2 OR 3";GOTO STARTPOINT)
|
||||
1010 ON K GOSUB PRINTA,PRINTB,PRINTC
|
||||
1020 PRINT "BYE"
|
||||
Reference in New Issue
Block a user