Datasheet
LABELS
Labels serve as targets for the goto and gosub statements. Mark the desired state-
ment with label and colon like this:
label_identifier : statement
No special declaration of label is necessary in mikroBasic PRO for AVR.
Name of the label needs to be a valid identifier. The labeled statement and
goto/gosub statement must belong to the same block. Hence it is not possible to
jump into or out of routine. Do not mark more than one statement in a block with the
same label.
Note: The label
main marks the entry point of a program and must be present in the
main module of every project. See Program Organization for more information.
Here is an example of an infinite loop that calls the procedure
Beep repeatedly:
loop:
Beep
goto loop
129
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroBasic PRO for AVR
CHAPTER 5