OWBasic for Pocketviewer

Home INTRO Group COMPILER Alphabetical Index

Compiler conditions

#IF <constant Boolean expression>
<code>
#ENDIF

Directives can be used to make the compiler to skip some program code. For example, it is possible to write different code for different PV models.
The code between #IF and #ENDIF is not compiled if the condition is false.

Example:

! directives
#if #pvmodel=1
pv$="PV-x50X"
#endif
#if #pvmodel=2
pv$="PV-S750(+)"
#endif
#if #pvmodel=3
pv$="PV-Sx50"
#endif
#if #pvmodel=4
pv$="PV-Sx60"
#endif
#if #pvmodel=5
pv$="PV-S1600"
#endif

CONST MAX=12
#if not vardef(MAX)
CONST MAX=13
#endif

#if not procfuncdef!(myproc)
proc myproc a,b
print a,b,a*b
endp
#endif

#if 5*7=35
print "ich kann kopfrechnen"
#endif

Home INTRO Group COMPILER Alphabetical Index