Computer Science Canada exit the procedure |
Author: | be natural* [ Tue Jun 10, 2003 8:07 am ] |
Post subject: | exit the procedure |
is there any code for just exiting a procedure? |
Author: | Prince [ Tue Jun 10, 2003 10:02 am ] |
Post subject: | |
exit? (or does that jus kick u outta loops ) |
Author: | Tony [ Tue Jun 10, 2003 1:32 pm ] |
Post subject: | |
yeah -> return |
Author: | Tendulkar [ 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 |
Author: | AsianSensation [ Wed Nov 26, 2003 11:59 pm ] |
Post 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. |
Author: | Andy [ Thu Nov 27, 2003 11:51 am ] |
Post 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 |