Quck Question for procedures!!! sould take just a sec
Author |
Message |
thainfamous
|
Posted: Tue Nov 30, 2004 10:26 am Post subject: Quck Question for procedures!!! sould take just a sec |
|
|
When you make a procedure, how do you make an if statement checking if the procedure has been processed.
Example: there is a procedure that makes someone move and you want to check if that procedure has been executed. If it has been processed, then do something, otherwise do not |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Mazer
|
Posted: Tue Nov 30, 2004 12:09 pm Post subject: (No subject) |
|
|
I'm not sure what you're trying to do. Why not just do this at the end of the procedure? |
|
|
|
|
|
cool dude
|
Posted: Tue Nov 30, 2004 1:14 pm Post subject: (No subject) |
|
|
i'm not sure wat u want but by my understanding u just want to see if the procedure works. all u have to do is call the procedure right after u made it. |
|
|
|
|
|
Delos
|
Posted: Tue Nov 30, 2004 2:57 pm Post subject: (No subject) |
|
|
code: |
var run : array 1..3 of boolean
for i : 1..3
run(i) := false
end for
procedure firstToRun
put "I'm first!"
run(1) := true
end firstToRun
% other procs...
firstToRun
secondToRun
% Note! No 'thirdToRun' is called.
if run(1) then
put "Yes, the first has run."
else
put "Nope, one has not run"
end if
%...etc etc.
|
BTW, I typed this directly into the reply box, so there may be syntax errors etc...you get the point of it though. |
|
|
|
|
|
wtd
|
Posted: Tue Nov 30, 2004 3:13 pm Post subject: (No subject) |
|
|
Well, since it's a procedure, I assume it's changing something. So just check to see if that thing it's changing has... changed.
Of course, the real question is why you question whether or not it's running.
Post the code! |
|
|
|
|
|
|
|