
-----------------------------------
cutiegirl_14_16
Sat May 24, 2003 5:57 pm

label problem
-----------------------------------
My program runs, but when I choose anything but a (like b or c) the program stops. And it says "case selector is out of range" but,it will let me choose only a.

how do I fix this?????
any help would be great!
thank u

-----------------------------------
Tony
Sat May 24, 2003 8:00 pm


-----------------------------------
thats because you dont have case "b": or case "c": or anything... cant select something you dont have :?

Atleast after properly indenting the file, I wasnt able to find those cases...

To be honest... this program layout is horrible. I mean if your last 20 lines are all "end case" you gotta screw up somewhere... and its too hardcoded, which is bad

To better organize it, ether use procedures, or better yet, load up the questions from the files  :D

-----------------------------------
cutiegirl_14_16
Sat May 24, 2003 9:22 pm


-----------------------------------
this is the only way I know how 2 make it. We didn't learn any processes, so i had 2 find and figure out the music one on my own. So I don't understand what u mean by use procedures?? wut procedures? and i don't know ne other way 2 put the question' s in.
Sorry, if it was hard to read. :oops:

-----------------------------------
Prince
Sat May 24, 2003 10:08 pm


-----------------------------------
u use case an awful lot, sumtimes its not even necessary... and yea, a few functions and/or procedures would clean it up nicely so that the code doesnt look all scrambled like... and so it isnt so wordy create sum text files to keep the information and then load em wen u need to... id like to offer more suggestions but i lost myself tryna read thru the code :?... but so far it looks like good educational fun (if there is such a thing :twisted:)

-----------------------------------
Tony
Sat May 24, 2003 11:30 pm


-----------------------------------
I've writen a tutorial on procedures... its basically a piece of code that you have condensed into a single "name". 


procedure word
put "tony is cool"
end word

put "now calling procedure"
word


so for each question, you just have a procedure writen... so intead of having tons of code to look through, the logical part of your program will be redused to:


case a:
procedureA
case b:
procedureB
end case


much easier to look though.
