6.8.3.8 Test Statement

Syntax

test test-expression error-expression

Description

The test statement evaluates the test-expression; if it is true (nonzero), the value of the test statement is error expression, and the test statement terminates the execution of the formula. If the test-expression is false, the value of the test statement is an empty string (no error) and execution continues with the next statement. The test statement should only be used in Edit/Match formulas.

The test statement is a shortcut for specifying Edit/Match tests. You can use several test statements to verify that all the conditions are met.

Examples

The following two examples are equivalent

test price > 100 "price too big"

test price <= 0 "price too small"

if price > 100

return "price too big"

endif

if price <= 0

return "price too small"

endif