HTP

Source code: ref/if.htp

Table of Contents
  htp.def
  macros.def
  htp.htt

<BLOCK syntax>
<IF [NOT] conditional>
    block #1
[
<ELSEIF [NOT] conditional>
    block #2
...
]
[
<ELSE>
    block #3
]
</IF>
</BLOCK>

<BLOCK synopsis>

<STRONG>IF, NOT, ELSEIF, ELSE, and /IF</STRONG> are the building
blocks for conditional processing.  The basic form is shown above.
<P> "Conditional" is either a "compare" or "is defined" operation.  A
compare operator is a test of the value of a macro against a literal
string:

<htpcode>
    <IF name="Jim">...</IF>
</htpcode>
<P>
and a defined operator is a test of a macro's existance:
<P>
<htpcode>
    <IF name>...</IF>
</htpcode>
<P>
If the NOT tag is present in the IF markup, the evaluation of the
conditional is reversed.  The first IF or ELSEIF condition that
evaluates to true is chosen.  If none of the conditions is true the
ELSE block is taken if it is present.  A conditional block
<EM>must</EM> be closed with the /IF tag.  IF tags can be nested.

</BLOCK>

  page source
  htp project
  htp homepage
hosted by
SourceForge.net
HTML coding Powered by htp
htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2003 Jochen Hoenicke.
Permission to reproduce and distribute this hypertext document granted according to terms described in the License section.

last updated Tue Feb 22, 2011