User`s manual

mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
Conditional statements control which part(s) of the program will be executed,
depending on a specified criteria. There are two conditional statements in
mikroBasic:
SELECT CASE statement,
IF statement.
We suggest browsing the chapters Relation Operators and Implicit Conversion and
Relation Operators, if you have not done so already.
Labels represent a more clear-cut way of controlling the program flow. You can
declare a label below variables declarations, but you cannot declare two labels
under the same name within the same routine. Name of the label needs to be a
valid identifier. Multiple label declarations in single line are not allowed.
Goto statement jumps to the specified label unconditionally, and the program exe-
cution continues normally from that point on.
Here is an example:
program test
dim jjj as byte
main:
' some instructions ...
goto myLabel
' some instructions...
myLabel:
' some instructions...
end.
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
87
page
CONDITIONAL STATEMENTS
Labels and Goto