October 30, 2025, 08:56:52 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


GOTO Label...

Started by Haim, May 31, 2006, 01:22:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Haim

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

Mike Stefanik

May 31, 2006, 01:30:14 PM #1 Last Edit: May 31, 2006, 01:31:49 PM by Mike Stefanik
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.
Mike Stefanik
www.catalyst.com
Catalyst Development Corporation

Ionic Wind Support Team

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.
Ionic Wind Support Team

Parker

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 :

Haim

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  ;)