User manual

196
mikoPascal PRO for PIC32
MikroElektronika
Labels
Labels serve as targets for goto statements. Mark the desired statement with a label and colon like this:
label_identier : statement
Before marking a statement, you must declare a label. Labels are declared in declaration part of unit or routine, similar
to variables and constants. Declare labels using the keyword label:
label label1, ..., labeln;
Name of the label needs to be a valid identier. The label declaration, marked statement, and goto statement must
belong to the same block. Hence it is not possible to jump into or out of a procedure or function. Do not mark more than
one statement in a block with the same label.
Here is an example of an innite loop that calls the Beep procedure repeatedly:
label loop;
...
loop:
Beep;
goto loop;
Note : Label should be followed by end of line (CR) otherwise compiler will report an error.
label loop;
...
loop: Beep; // compiler will report an error
loop: // compiler will report an error