User`s manual
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
Compiler treats the construction like this:
if expression1 then
[ if expression2 then
statement1
else
statement2
end if ]
end if
To force the compiler to interpret our example the other way around, we would
have to write it explicitly:
if expression1 then
if expression2 then
statement1
end if
else
statement2
end if
if J <> 0 then
Res = I div J
end if
if j <> 0 then
i = i + 1
j = 0
end if
...
if v = 0 then
portb = por2
porta = 1
v = 1
else
portb = por1
porta = 2
v = 0
end if
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
91
page
Examples