Boolean Operators

A 4GL Boolean operator returns TRUE (= 1), FALSE (= 0) or NULL. They closely resemble the set of SQL Boolean operators, but some are not identical.

4GLREF00000067.gif

Relational Operators

This is the syntax for relational comparisons in 4GL Boolean expressions:

4GLREF00000068.gif

The NULL Test

If any operand of a 4GL Boolean comparison or is NULL, then the value of the comparison is FALSE (rather than NULL), unless the IS NULL keywords are also included in the expression. Applying the NOT operator to a NULL value does not change its FALSE evaluation.

If you need to process expressions with NULL values in a different way from other values, you can use the IS NULL keywords to test for NULL value.

4GLREF00000069.gif

LIKE and MATCHES Operators

The LIKE or MATCHES operators test whether a character value matches a quoted string that can include wild card characters. If an operand has a NULL value, then the entire string comparison returns NULL. Use a NULL test if you want to detect and exclude NULL values.

4GLREF00000070.gif

Set Membership and Range Tests

The BETWEEN . . . AND and IN( ) operators that test for set membership or range are supported in three contexts:

SQL statements

The WHERE clause of the COLOR attribute in 4GL form specifications

The condition column of the syscolatt table

They are not valid in 4GL statements that are not also SQL statements.

This is the syntax for using the IN( ) operator to test for set membership.

4GLREF00000071.gif

If you omit the NOT keyword, this returns TRUE if any expression in the list (within parentheses) at the right matches the expression on the left.

If you include the NOT keyword, the test evaluates as FALSE if no expression in the list matches the expression on the left.

This is the syntax for the BETWEEN . . . AND operators to test whether a value is included within a specified range (or an inclusive interval on the real line):

4GLREF00000072.gif

References

FIELD_TOUCHED( )

INFIELD( )