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

Username:   Password: 
 RegisterRegister   
 Returning to input
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
typon




PostPosted: Sun Jan 16, 2005 12:27 pm   Post subject: Returning to input

hi, i'm having a problem with errorproofing. K E.g. if there are 3 numbers that i want from the user. they enter the first number correct, but they make a mistake on the second number, i error trap it so it an errorwindow pops up.
but when i say

loop
exit when hasch
end loop
userinput(procedure)

it will start from asking the first number again. is there a way to continue the procedure from a specific point?
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Sun Jan 16, 2005 1:53 pm   Post subject: (No subject)

you probably have to set a couple of boolean variables inside your procedure.

Like in your get procedure, you have something like this:

code:

get num1
get num2
get num3


now incorporate some flags:

code:
flag1 := false
flag2 := false

if flag1 = true and flag2 = true then
    get num3
elsif flag1 = true
    get num2
    flag2 := true
else
    get num1
end if


so that you check to see whether you have gotten the number before.
typon




PostPosted: Sun Jan 16, 2005 5:56 pm   Post subject: (No subject)

What?
Cervantes




PostPosted: Sun Jan 16, 2005 6:49 pm   Post subject: (No subject)

Do you know what boolean variables are?
Think about it. Work it out. Yourself.
hint: Asian left one line out of that if statement.
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: