
-----------------------------------
be natural*
Tue Jun 10, 2003 8:07 am

exit the procedure
-----------------------------------
is there any code for just exiting a procedure?

 :shock:  :cry:

-----------------------------------
Prince
Tue Jun 10, 2003 10:02 am


-----------------------------------
exit? (or does that jus kick u outta loops :?)

-----------------------------------
Tony
Tue Jun 10, 2003 1:32 pm


-----------------------------------
yeah -> return

-----------------------------------
Tendulkar
Tue Nov 25, 2003 10:54 pm

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
Wed Nov 26, 2003 11:59 pm


-----------------------------------
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
Thu Nov 27, 2003 11:51 am


-----------------------------------
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
