Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 error trap problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kanetix




PostPosted: Tue Jan 13, 2004 9:26 pm   Post subject: error trap problem

i'm having a error trap problem with my project

here's the code for the main program:

%Main Program
introduction
loop
loop
mainMenu
if operation < 1 or operation > 7 then
put "invalid input"
else
exit
end if
end loop
if operation = 7 then
exit
end if
loop
userInput
if amount < 1 then
put "invalid input"
else
exit
end if
end loop
display
end loop
goodBye

Problem is, the "invalid input" never shows, instead whenever you try to put operation as <1 or >7 and you press enter it the number just erases ... why?
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Tue Jan 13, 2004 10:02 pm   Post subject: (No subject)

eh....post up the rest of your code, we don't know the procedures you declared, so post those up as well.
help_wanted




PostPosted: Thu Jan 15, 2004 8:25 pm   Post subject: mayb

k first why do you have 2 loops at once?? Confused
Thuged_Out_G




PostPosted: Thu Jan 15, 2004 8:40 pm   Post subject: (No subject)

2 loops are used to fake a goto line command...heres an example, i didnt understand this at first either lol

loop
main program...like a menu
put "option 1"
put "option 2"
put "option 3"
get selection

loop
if selection=1 then
put "1"
exit %when you exit this loop, it will go back to the beginning of the first loop
end if
end loop
end loop

therefor you can run your program over and over until the user wants to exit
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: