Previous ION Script User's Guide: ION Script Tag Reference Next

ION_IF, ION_ELSEIF, ION_ELSE

The ION_IF tag pair is the main flow-control tag in ION Script. It allows parts of an ION Script document to be conditionally evaluated and displayed. This feature allows you to build interactive Web-based applications.

When an ION_IF tag is encountered in a Web page, the ION Script parser evaluates the expression. If the expression evaluates to TRUE, all content up to either the closing ION_IF tag or the first internal ION_ELSEIF or ION_ELSE tag is processed. If the expression evaluates to FALSE, the parser searches for an ION_ELSEIF or ION_ELSE tag. If an ION_ELSEIF tag is encountered, its expression is evaluated and processing continues as with ION_IF. If an ION_ELSE tag is encountered, the content between the opening and closing ION_IF tags is processed.

Both ION Script and HTML content can be conditionally displayed.

Syntax

<ION_IF EXPR="expression">

ION or HTML content

[<ION_ELSEIF EXPR="expression" />

ION or HTML content

[<ION_ELSE />

ION or HTML content

</ION_IF>

Attributes

EXPR

The expression to be evaluated by the parser. This attribute can contain a variable. See Variables, Expressions & Operators for details on writing ION Script expressions.

HTML Mapping

The ION_IF, ION_ELSEIF, and ION_ELSE tags do not directly produce any HTML output, however, any valid HTML can be contained within the <ION_IF>...</ION_IF> tag pair. The EXPR attribute of the ION_IF, ION_ELSEIF, and ION_ELSE tags is evaluated to determine which content to process.

  IDL Online Help (March 06, 2007)