Conditional structures: Difference between revisions
m
added debug/platform example
m (typo) |
m (added debug/platform example) |
||
Line 4,010:
In an iff() expression, only one of true_expr or false_expr will be evaluated, not both.
Phix has some rudimentary support of preprocessor ifdef statements, but their use is discouraged since
first if statement, and in the second the conditions are evaluated at compile-time and code is only
emitted for one of the branches.
<lang Phix>constant DEBUG=false
if DEBUG then
puts(1,"debug is on\n")
end if
if platform()=WINDOWS then
puts(1,"this is windows\n")
elsif platform()=LINUX then
puts(1,"this is linux\n")
end if</lang>
===switch===
|