Computer Science Canada Need Procedures Help |
Author: | s33nw33n [ Thu Jun 15, 2006 4:32 pm ] | ||
Post subject: | Need Procedures Help | ||
Hi. Say if I have a program setup like this:
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] |
Author: | Delos [ Thu Jun 15, 2006 4:47 pm ] | ||
Post subject: | |||
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:
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! |
Author: | s33nw33n [ Thu Jun 15, 2006 4:50 pm ] |
Post subject: | |
Delos wrote: 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. |