Purpose
The macro IF block performs conditional string processing and is used within the declaration part of the Net.Data macro. Numeric values are treated as strings for comparisons.
Syntax
+-----------------------+
V |
>>-%if--| condition list |-----+--------------------++---------->
+-exec_sql statement-+
+-define statement---+
+-function statement-+
+-function call------+
+-HTML block---------+
+-message block------+
>--| else_if spec |--%endif------------------------------------><
condition list
|--(--+-(--condition list--)----------------+-)----------------|
+-condition list--&&--condition list--+
+-condition list--||--condition list--+
+-!--condition list-------------------+
+-| condition |-----------------------+
+-| term |----------------------------+
condition
|--term--+-<--+-term-------------------------------------------|
+->--+
+-<=-+
+->=-+
+-!=-+
+-==-+
term
|--+-variable reference-+--------------------------------------|
+-"--string--"-------+
+-variable name------+
else_if spec
|--+----------------------------------------------------------------+->
| +-------------------------------------------------------+ |
| | +-----------------------+ | |
| V V | | |
+--+--%elif--(--condition_list--)----+--------------------++-+-+-+
| +-exec_sql statement-+ |
| +-define statement---+ |
| +-function statement-+ |
| +-function call------+ |
| +-HTML block---------+ |
| +-message block------+ |
| +-----------------------+ |
| V | |
+-%else----+--------------------++--------------------------+
+-exec_sql statement-+
+-define statement---+
+-function statement-+
+-function call------+
+-HTML block---------+
+-message block------+
>--------------------------------------------------------------|
Parameters
Context
Can be found in these contexts:
Restrictions
Can contain these elements:
Examples
Example 1:
%IF ($(DTW_HTML_TABLE)) %define OUT_FORMAT = "HTML" %ELSE %define OUT_FORMAT = "CHARACTER" %endif