[ < ] | [ > ] | [Contents] | [Index] | [ ? ] |
Conditional directives may be used to conditionnaly skip blocks of
code. There are 4 conditional directives: if
, elseif
,
else
and endif
. +if
begins a conditional directives
sequence, with argument a conditional expression. If the expression is
true the block of code following the +if
is output in the
resulting file, up to another conditional directive, if it is false
the code block is skipped. If the
expression is false and the following conditional directive is
+elseif
, the same procedure is followed with the argument of
+elseif
which is also a conditionnal expression. More than one +elseif
may follow a +if
. If a +if
or +elseif
expression
is true the following
code block is output and all
the following +elseif
code blocks are skipped. If all the +if
and +elseif
expressions are false and
the following coditionnal
directive is +else
then the block following the
+else
is output. If a previous expression was true the
code block following the +else
is skipped. The last code block
is closed by +endif
.
Conditionnal directives may be nested, a +if
begins a deeper
conditionnal sequences directives that is ended by the corresponding
+endif
.
The simplest example is:
some code; +IF,monitor code output only if monitor is true; +ENDIF
If ‘monitor’ is selected, the +if
block is output, it leads to
some code; code output only if monitor is true;
If ‘monitor’ isn’t selected the +if
block is skipped, it leads to
some code;
An example with +else
may be:
+IF,double call dmysub(eta); +ELSE call smysub(eta); +ENDIF
If ‘double’ is selected the code output is call dmysub(eta);
,
if ‘double’ isn’t selected the code output is call dmysub(eta);
.
Here is a self explanatory example of use of +elseif
:
+IF,monitor code used if monitor is selected; +ELSEIF,kalman code used if kalman is selected and monitor is not; +ELSE code used if kalman and monitor are not selected; +ENDIF
And last an example of nested conditional directives:
+IF,monitor code used if monitor is selected; +_IF,kalman. deep if code used if monitor and kalman are selected; +_ELSE. deep else code used if monitor is selected and kalman is not; +_ENDIF. end the deep conditionnals sequence +ELSE code used if monitor is not selected; +_IF,kalman code used if monitor is not selected but kalman is; +_ELSE code used if monitor and kalman are not selected; +_ENDIF other code used if monitor is not selected; +ENDIF
[Contents] | [Index] | [ ? ] |
This document was generated by a tester on a sunny day using texi2html.