IF [NOT] where_clause [, where_clause]
END_IF


END_IF marks the end of the set of commands to be executed once if the current row meets the specified criteria.

where_clause is of the form:

  • field_data IS text_data
  • field_data ISNOT text_data
  • field_data CONTAINS text_data
  • field_data STARTSWITH text_data
  • field_data ENDSWITH text_data
  • field_data ISLESS numeric_data (or date_data)
  • field_data ISLESSOREQUAL numeric_data (or date_data)
  • field_data ISMORE numeric_data (or date_data)
  • field_data ISMOREOREQUAL numeric_data (or date_data)
  • field_data ISMULTIPLEOF numeric_data

text_data is either a piece of literal text (* see below) to compare against (normal rules apply, see the TEXT command for details), or field_data. CURRENT and the dot are not required, as fields are always from the current loop row being examined (i.e., the one in progress before this IF command). Once again normal rules for field names apply (see the FIELD command for details).

NOT will examine the criteria for a match, and then do the opposite. Thus, a typical condition might be:

IF "Brother" ISNOT "J. Samuels"

IF NOT "Talk Number" ISLESS "1000".

Note IconNote that you can combine multiple condition clauses by separating with commas. All such clauses are applied to the current row to determine if it is acceptable, and if not, the contents of the IF are ignored. Any condition clauses that cannot be understood are ignored and no attempt is made to apply them to the current row (but any other clauses on the line are still checked).

Note IconNote also that you can embed inner loops and IFs within existing loops or Ifs, but for Ifs, the row being examined is always the current row from the innermost LOOP containing the IF.

Each IF must be matched by an END_IF, and all commands between those two commands will be executed if the current row matches the criteria.

field_data is exactly as for the FIELD command.

Unlike commands such as FONT, the keywords and parameters for the IF command, if supplied, must be supplied in the order shown. Condition clauses obviously can be in any order, though, within their section of the command.

text_data* The text value can also be a variable name, such as $variable. Also, it is important to use valid text if specifying literal text. Depending on the field type, you must follow this set of rules (not that you don't need to worry if you are creating the script through the editor).

Text Field

Text fields have no limitations. Virtually any value is accepted.

Numeric Field

Number fields expect to be numeric. So only use numbers (0 to 9)

Tentative Field

Tentative field is actually a YES/NO field. Use:

  • 0 for YES
  • 1 for NO

Date Field

Date fields must follow a strict pattern: #YYYY MM DD#

For example, given the date "January 4th, 1999", it would be represented with:

#1999 01 04#


Example:

IF "Chairman" IS "Chairman 1"
    (commands go inside IF)
END_IF