File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <input.bas>
2
+
3
+ 10 PRINT "Enter a number from 0 to 9"
4
+ PRINT "Only values 0, 1 and 2 will"
5
+ PRINT "be dispatched"
6
+ PRINT "> " ;
7
+ LET X$ = INPUT( 1 )
8
+ IF X$ < "0" or X$ > "9" THEN GOTO 10
9
+ 20 LET ok = 0
10
+ ON VAL(X) GOSUB 50 , 100 , 150 : IF ok THEN END
11
+ GOTO 10
12
+ 30 PRINT "Invalid choice: " ; X
13
+ 40 RETURN
14
+ 50 PRINT "You chose option 0" : LET ok = 1
15
+ 60 RETURN
16
+ 100 PRINT "You chose option 1" : LET ok = 1
17
+ 110 RETURN
18
+ 150 PRINT "You chose option 2" : LET ok = 1
19
+ 160 RETURN
20
+
Original file line number Diff line number Diff line change
1
+ #include <input.bas>
2
+
3
+ 10 PRINT "Enter a number from 0 to 9"
4
+ PRINT "Only values 0, 1 and 2 will"
5
+ PRINT "be dispatched"
6
+ PRINT "> " ;
7
+ LET X$ = INPUT( 1 )
8
+ IF X$ < "0" or X$ > "9" THEN GOTO 10
9
+ 20 ON VAL(X) GOTO 50 , 100 , 150
10
+ 30 PRINT "Invalid choice: " ; X
11
+ 40 GOTO 10
12
+ 50 PRINT "You chose option 0"
13
+ 60 END
14
+ 100 PRINT "You chose option 1"
15
+ 110 END
16
+ 150 PRINT "You chose option 2"
17
+ 160 END
18
+
You can’t perform that action at this time.
0 commit comments