HTP

Source code: ref/while.htp

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



<BLOCK syntax>
<WHILE [NOT] conditional>
    block
</WHILE>
</BLOCK>

<BLOCK synopsis>

<STRONG>WHILE</STRONG> is the building block for repeated 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.
If the NOT tag is present in the WHILE markup, the evaluation of the
conditional is reversed:

<htpcode>
  <WHILE NOT i="10">
    ...
    <INC i>
  </WHILE>
</htpcode>
<P>

Just as with <manlink href="if.html">IF</manlink> you can also check for a
macro's existance:

<htpcode>
  <WHILE sect-$i>
    ...
    <INC i>
  </WHILE>
</htpcode>

<P>
If the condition is true, the block is evaluated and afterwards the
WHILE tag is evaluated again.  If the '$'-operator is used in the
WHILE tag it is also reevaluated on each iteration.
<P>
A loop block <EM>must</EM> be closed with the /WHILE tag.

</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