I saw that Aurora recognizes goto and label.
Can anyone show me how to declare a label, and use it with goto?
Sorry to bother with such a low-tech question, but I'm curious. :)
Haim
The goto statement is the mark of the devil. So put Satan behind you and just say "NO" to the cloud of utter doom and darkness that it portends! Otherwise, you and your program will be consorting with the unclean demonkind known as "spaghetti code".
Paul would never do it, but every time the compiler encounters a goto statement, it should emit a warning and play the sound of a woman screaming in terror.
There are very few uses for a goto. But in Aurora you can just define a label and then jump to it.
goto mylabel;
...
mylabel:
I left it in Aurora's syntax for consistancy with other languages.
Also, labels with the colon can only be declared when it is alone on the line (not even whitespace), but you can use the LABEL keyword, or the #emit keyword. The following three statements are equivalent.
theLabel:
label theLabel;
#emit theLabel :
Thanks to all responders.
I am well aware of the devil lurking behind goto, still I was curious to see how it was implemented in aurora.
I promise to behave ;)