
-----------------------------------
s33nw33n
Thu Jun 15, 2006 4:32 pm

Need Procedures Help
-----------------------------------
Hi.
Say if I have a program setup like this:


procedure 1
....
end 1

procedure 2
....
end 2

procedure 3
....
end 3


If I want to use procedure 3 in procedure 1, it will give me a error that procedure 3 hasn't been declared because its below the code. Is there a way to tell the program to go down and check the rest of the code before giving an error?

Thanks[/code]

-----------------------------------
Delos
Thu Jun 15, 2006 4:47 pm


-----------------------------------
Ah, circular dependance.  TOTG will likely be by soon enough to give you further details to this wonderful problem which he has had more than his share of time in, but essentially you do something like this:


forward proc _1

body proc _1
%...
end proc _1


I'm not entirely certain if this is the syntax, but that's the general idea.  I will, however, ask you if you can think of no other way to solve your problem other than using this form of coding - which if you're not careful, can be quite painful to debug.  Not to mention dangerous if you hit two procs that indefinitely call each other!

-----------------------------------
s33nw33n
Thu Jun 15, 2006 4:50 pm


-----------------------------------

I will, however, ask you if you can think of no other way to solve your problem other than using this form of coding

Thanks Delos. I SERIOUSLY appreciate this. My projects due tomorrow.

Well, all procedures are interconnected together, so I have to find a way to do this. Thanks, I will play around with the forward/body stuff and see if I can get this to work.
