Author |
Message |
greenapplesodaex
![](http://img.photobucket.com/albums/v235/greenapplesodaex/big.jpg)
|
Posted: Tue Jun 08, 2004 8:48 pm Post subject: how do i stop a procedure? |
|
|
Can I exit a procedure like exiting a loop? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
aside
|
Posted: Tue Jun 08, 2004 8:49 pm Post subject: (No subject) |
|
|
use return. |
|
|
|
|
![](images/spacer.gif) |
greenapplesodaex
![](http://img.photobucket.com/albums/v235/greenapplesodaex/big.jpg)
|
Posted: Tue Jun 08, 2004 8:53 pm Post subject: reply |
|
|
so... if i use return, will the program still shut down?
it said
procedure double
if errorHasOccurred then
return % Terminate this procedure
end if
"¦ handle usual case in this procedure "¦
end double
what's "errorHasOccurred", turing gave me an error on that |
|
|
|
|
![](images/spacer.gif) |
aside
|
Posted: Tue Jun 08, 2004 8:57 pm Post subject: (No subject) |
|
|
or you can use "exit" if you are using a loop, if you are not sure. personally i have never use return before, i always use exit |
|
|
|
|
![](images/spacer.gif) |
greenapplesodaex
![](http://img.photobucket.com/albums/v235/greenapplesodaex/big.jpg)
|
Posted: Tue Jun 08, 2004 9:08 pm Post subject: reply |
|
|
i know how to exit a loop
i'm asking how to stop a procedure
take a look at this code, can you tell me y it doesnt work?
var errorOccurred : boolean := false
procedure double
if Error.Last = eNoError then
else
errorOccurred := true
put "error"
end if
if errorOccurred = true then
put "error"
return
end if
end double
for i : 1 .. 300
double
colour (i)
double
put i, " " ..
double
end for |
|
|
|
|
![](images/spacer.gif) |
TheZsterBunny
![](http://www.members.shaw.ca/rfolz/zstervava2.jpg)
|
Posted: Thu Jun 10, 2004 5:25 pm Post subject: (No subject) |
|
|
use return.
imagine your procedure like a loop.
now sub exit for return
its like the result command in functions. it quits the procedure, and continues along the mainline. if you use return not in a procedure, it quits your prog.
-Z |
|
|
|
|
![](images/spacer.gif) |
|