12-03-2003, 05:54 AM
This is a fairly antiquated method, but it should work:
Notice the addition of the 4th menu option, the label right before the menu, and the GOTO after the SELECT block.
Code:
CLS
PRINT "How many nails are in stock?"
INPUT a
PRINT "How many screws are in stock?"
INPUT b
PRINT "How many bolts are in stock?"
INPUT c
PRINT "How many flanges are in stock?"
INPUT d
PRINT "How many grommets are in stock?"
INPUT e
menu:
CLS
PRINT "1. Sell an Item"
PRINT "2. Return an Item"
PRINT "3. Inventory"
PRINT "4. Quit"
DO WHILE a$ = ""
a$ = INKEY$
LOOP
SELECT CASE a$
CASE IS = "1"
PRINT "Which item would you like to sell?"
PRINT "A. Nails"
PRINT "B. Screws"
PRINT "C. Bolts"
PRINT "D. Flanges"
PRINT "E. Grommets"
INPUT b$
IF b$ = "a" THEN a = a - 1
IF b$ = "b" THEN b = b - 1
IF b$ = "c" THEN c = c - 1
IF b$ = "d" THEN d = d - 1
IF b$ = "e" THEN e = e - 1
CASE IS = "2"
PRINT "Which item would you like to sell?"
PRINT "A. Nails"
PRINT "B. Screws"
PRINT "C. Bolts"
PRINT "D. Flanges"
PRINT "E. Grommets"
INPUT c$
IF c$ = "a" THEN a = a + 1
IF c$ = "b" THEN b = b + 1
IF c$ = "c" THEN c = c + 1
IF c$ = "d" THEN d = d + 1
IF c$ = "e" THEN e = e + 1
CASE IS = "3"
PRINT a, b, c, d, e,
CASE IS = "4"
END
END SELECT
GOTO menu
I'd knock on wood, but my desk is particle board.