Rich |
Does anyone know exactly how the Goto command works in AGI? I know that this command exists but I don't see any listing of it or its syntax in the AGI Help file. I don't need this command to make my game work, but it will immensely help with a sequence I am working on right now. Thanks! |
BI lazy |
usually goto [label] is a unconditional branch to another position in program flow. It shall not be used, for it breaks the rules of Nassi Shneiderman. *gg* Hence the third Commandmend of Kerrigan: "Thou Shalt Not Use the Goto!" |
Joel |
I think it's something like:
|
Brian_Provinciano |
The else is just a structured goto. Goto jumps from one point in the logic to another point. It is just like an if, but non conditional. if(foo) { ... // if code } else { ... // else code } Is the same as: if(foo) { ... // if code goto else_done; } ... // else code else_done: It can be used with if statements to make efficient (but unstructured) code that does funky things. |
Rich |
Thanks, guys. I had a bit or repeated code and I realized that ultimately a goto statement was the best way to go about it... even though I've tried to program for over a decade without ever using a goto again. Oh well. They're there for a reason. |