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

Username:   Password: 
 RegisterRegister   
 exit the procedure
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
be natural*




PostPosted: Tue Jun 10, 2003 8:07 am   Post subject: exit the procedure

is there any code for just exiting a procedure?

Shocked Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
Prince




PostPosted: Tue Jun 10, 2003 10:02 am   Post subject: (No subject)

exit? (or does that jus kick u outta loops Confused)
Tony




PostPosted: Tue Jun 10, 2003 1:32 pm   Post subject: (No subject)

yeah -> return
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tendulkar




PostPosted: Tue Nov 25, 2003 10:54 pm   Post subject: Re: exit the procedure

% HERE IS YOUR CODE
var name : string
put "Enter the name: " ..
get name
procedure the_name
loop
if name = "Compsci" then
exit
else
put "Enter it again: " ..
get name
end if
exit when name="Compsci"
end loop
end the_name

the_name
AsianSensation




PostPosted: Wed Nov 26, 2003 11:59 pm   Post subject: (No subject)

return is still better, cuz if you always make your procedures into loops, then you would have a hard time later running those things in the main loop. Dodge had trouble with those kind of problems when he didn't use return for one of his programs. He had like double loops and he needed to exit both, so he had to make all these flags to make sure he exits them. Very messy, don't want yourself to get caught in that.
Andy




PostPosted: Thu Nov 27, 2003 11:51 am   Post subject: (No subject)

hey leave my 5 different types of exit flags alone... lol i had like 5 loops inside each other... the code was so indented, you cant even see the text without scrolling o yea, use return
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  [ 6 Posts ]
Jump to:   


Style:  
Search: