htp on-line reference : IF, ELSE, /IF

table of contents
  Introduction
  Usage
  Files
  Concepts
  HTP Tags
   ALTTEXT
   BLOCK
   BLOCKDEF
   DEF
   FILE
   IF
   INC
   IMG
   OPT
   OUTPUT
   QUOTE
   SET
   UNDEF
   UNSET
   USE, $
   WHILE
   <!---
  History
  Wish list
  Bugs

syntax

<IF [NOT] conditional>
    block #1
<ELSE>
    block #2
</IF>

synopsis

IF, NOT, ELSE, and /IF are the building blocks for conditional processing. The basic form is shown above.

"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 name="Jim">

and a defined operator is a test of a macro's existance:

    <IF name>

If the NOT tag is present in the IF markup, the evaluation of the conditional is reversed.

The ELSE operator is optional. The ELSE block is always included in the output if the IF operation evaluated false. Otherwise, it is ignored.

A conditional block must be closed with the /IF tag.

htp project

htp homepage

hosted by
SourceForge.net Logo

htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke, Michael Möller.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2002 Jochen Hoenicke, Michael Möller.
Permission to reproduce and distribute this hypertext document granted according to terms described in the Introduction

last updated Mon May 27, 2002