[TOC] [Prev] [Next] [Bottom]



<@IFEQUAL> <@ELSE> </@IF>

Syntax

<@IFEQUAL VALUE1=value1 VALUE2=value2>
trueSubstitutionText
[<@ELSE>
falseSubstitutionText]
</@IF>

Description

If the value of the VALUE1 attribute and the value of the VALUE2 attribute are equal, <@IFEQUAL> includes trueSubstitutionText; otherwise it includes falseSubstitutionText. Each of the attributes may be a meta tag or a literal value, or a combination of both. Literal values must be quoted if they contain a space. The <@ELSE> portion is optional.

<@IFEQUAL> can be used to do begins-with type comparisons. An asterisk at the end of either value acts as a wildcard character, matching any characters at the end of the other value attribute. (You can search for an asterisk character by using <@CHAR 42>.)

When comparing the values, Tango attempts to convert both values to numbers and perform a numeric comparison. If one or both values cannot be converted to numbers, Tango performs a string comparison.

The trueSubstitutionText and falseSubstitutionText may include other <@IF>, <@IFEMPTY>, and <@IFEQUAL>.

Mac OS

Macintosh only: These tags may be nested up to 12 levels; beyond this limit, an error is returned.

Examples

<@IFEQUAL VALUE1="<@CGIPARAM NAME='user_agent'>"
VALUE2="Mozilla*">
...HTML for Netscape Navigator...
<@ELSE>
...HTML for other Web browsers...
</@IF>

This example returns different HTML depending on the user's Web browser.

<SELECT NAME="region">

<OPTION VALUE="NE"
<@IFEQUAL VALUE1="<@COLUMN 'customer.region'>"
VALUE2="NE">SELECTED</@IF>>North East

<OPTION VALUE="NW"
<@IFEQUAL VALUE1=<@COLUMN customer.region>VALUE2"NW">SELECTED</@IF>>North West

<OPTION VALUE="SE" <@IFEQUAL VALUE1=<@COLUMN
customer.region> VALUE2="SE">SELECTED </@IF>>South
East

<OPTION VALUE="SW" <@IFEQUAL VALUE1=<@COLUMN customer.region>
VALUE2="SW">SELECTED</@IF>>South West

</SELECT>

This example sets the correct pop-up menu item to SELECTED based on the value of a database field.

See Also

<@IF>, <@ELSEIF>, <@ELSEIFEMPTY>, <@ELSEIFEQUAL>, </@IF>
<@IFEMPTY> <@ELSE> </@IF>



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1998, Pervasive Software Inc. All rights reserved.