Format
goto node
Jump to the specified node in the current proc.
goto End
world << "ERR"
End
world << "The end"
This displays “The end”.
Note
goto
should be used judiciously. It’s easy to fall into the trap of “spaghetti logic” wheregoto
is relied on so much that it becomes too difficult to follow how the flow of code execution will proceed. Normally, you’ll want to use a construct likewhile()
orfor()
loops, andbreak
andcontinue
statements.goto
is for more complex situations that aren’t readily handled by any of these.