September 2007
Intermediate to advanced
600 pages
20h 21m
English
ColdFusion if statements are created using the <cfif> tag. <cfif> takes no attributes; instead, it takes a condition. For example, the following <cfif> statement checks to see whether a variable named FirstName contains the value Ben:
<cfif FirstName IS "Ben">
The keyword IS is an operator used to test for equality. Other operators are supported, too, as listed in Table 9.1.
| Operator | Shortcut | Description |
|---|---|---|
| EQUAL | IS, EQ | Tests for equality |
| NOT EQUAL | IS NOT, NEQ | Tests for nonequality |
| GREATER THAN | GT | Tests for greater than |
| GREATER THAN OR EQUAL TO | GTE | Tests for greater than or equal to |
| LESS THAN | LT | Tests for less than |
| LESS THAN OR EQUAL TO | LTE | Tests for less than or equal to |
| CONTAINS | Tests whether a value is contained ... |
Read now
Unlock full access