Menu: Difference between revisions
Content added Content deleted
(Menu in Yabasic) |
(Applesoft BASIC) |
||
Line 303: | Line 303: | ||
end function</lang> |
end function</lang> |
||
==={{header|Applesoft BASIC}}=== |
|||
While the following example could be lengthened to demonstrate larger menu-driven projects, it is useful to simply print the resulting string indexed by the user input. |
|||
<lang applessoftbasic> 10 M$(4) = "TICK TOCK" |
|||
20 M$(3) = "MIRROR MIRROR" |
|||
30 M$(2) = "HUFF AND PUFF" |
|||
40 M$(1) = "FEE FIE" |
|||
50 GOSUB 100"MENU |
|||
60 PRINT M$ |
|||
70 END |
|||
100 M$ = "" |
|||
110 FOR M = 0 TO 1 STEP 0 |
|||
120 FOR N = 1 TO 1E9 |
|||
130 IF LEN (M$(N)) THEN PRINT N". "M$(N): NEXT N |
|||
140 IF N = 1 THEN RETURN |
|||
150 INPUT "ENTER A NUMBER:";N% |
|||
160 M = N% > = 1 AND N% < N |
|||
170 NEXT M |
|||
180 M$ = M$(N%) |
|||
190 RETURN </lang> |
|||
==={{header|Commodore BASIC}}=== |
==={{header|Commodore BASIC}}=== |