CASE question

I'm using True Basic Silver and I'm setting up a program for a project to shop online. My initial screen looks like this...

PRINT "1...display list of products and prices."
PRINT "2...display images of products."
PRINT "3...search for product prices."
PRINT "4...jump ahead and place order."
PRINT "5...leave HK.com"
PRINT
INPUT prompt "What would you like to do?": Choice

The one I'm having an issue with is CASE 1. The code looks like this

SET COLOR "magenta"
CALL Object (2, 0, "FONT NAME|FONT STYLE|FONT SIZE", fn$ & "|" & fs$, V())
CLEAR
PRINT "List of products and prices..."
PRINT
LET Format$ = "<########## $$$$.##"
DO while More data
READ Products$, Price
PRINT using Format$: Products$, Price
LOOP
PRINT
PRINT
PRINT "2...display images of products."
PRINT "3...search for product prices."
PRINT "4...jump ahead and place order."
INPUT prompt "5...leave HK.com.": Choice
CLEAR

Everything comes out correctly ONLY when CASE 1 is chosen the first time. But say if I choose CASE 1, then CASE 2, then chose CASE 1 again, everything but the Products and Price show up. So there is an empty gap.

Can anyone tell me what I am doing wrong? I'm sorry if my explanation is unclear, please let me know and I'll try to explain it better. The information is for Products$ and Price are being pulled from DATA at the bottom of my program. I just can't understand why the list will only show up one time.

Thank you!

Comments

Hi, My guess is that the

Hi,

My guess is that the problem stems from READINg data each time, e.g.
DO while More data
READ Products$, Price

You should only do this once at the top of your program, storing the data in an array so you can re-use the array for each CASE.

Take a look at the way menus are specified in the TrueCtrl section of the manual chapter 14. This will show you how to read data into an array using the MAT instruction.

Big John