Commodore VIC-20 User Manual page 102

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

900 PRINT"
910 PRINT
STEAK AND EGGS"
920 PRINT "TAKE 1 COOKED STEAK"
930 PRINT lLAND COOKED EGGS.1+
940 PRINT "SERVE TOGETHER WITH"
950 PRINT "BEVERAGE."
960 GOTO 590
If you typed the program
correctly and typed RUN.
the screen should come up
with the following display:
PLEASE PICK A CHOICE
FROM THE MENU:
A..,CHICKEN SOUP
B...SPAGHETTI
C...STEAK&EGGS
Now the VIC is waiting for you to hit a key. If you type
anything other than A. B, or C, nothing happens at aJf (Line
200 does this). If you hit the A, you get the recipe for Mikes
Chicken Soup. Pretty terrible, huh? You can tell Mike is a
bachelor.
This can be lengthened and modified very easily for your own
use. To add items to the menu, just add a PRINT statement
after fine 60, add a new IF statement after line 230, and add
the recipe wherever there is room at the end. The last line of
your recipe should be the line GOTO 590, which tells the per
son RUNning the program to hit a Key to continue. This will
keep the recipe on the screen until they are through with it.
You can use the program we just described for more than
recipes, of course. How about a name and address file? In
stead of a "menu1* use last names with initials. Instead of
recipes, use the person's name, address and phone number.
Can you think of other uses for GET and INPUT based pro
grams? This is the true power of computing—being able to
tailor what the computer does to your own needs.
92

Advertisement

Table of Contents
loading

Table of Contents