label problem
Author |
Message |
cutiegirl_14_16
|
Posted: Sat May 24, 2003 5:57 pm Post subject: 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
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
summative2.t |
Filesize: |
40.08 KB |
Downloaded: |
391 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sat May 24, 2003 8:00 pm Post subject: (No subject) |
|
|
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
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
cutiegirl_14_16
|
Posted: Sat May 24, 2003 9:22 pm Post subject: (No subject) |
|
|
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.
|
|
|
|
|
![](images/spacer.gif) |
Prince
![](http://www.angelfire.com/hiphop3/m-unit_hustla/images/fxckpare.jpg)
|
Posted: Sat May 24, 2003 10:08 pm Post subject: (No subject) |
|
|
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 )
|
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sat May 24, 2003 11:30 pm Post subject: (No subject) |
|
|
I've writen a tutorial on procedures... its basically a piece of code that you have condensed into a single "name".
code: |
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:
code: |
case a:
procedureA
case b:
procedureB
end case
|
much easier to look though.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|