is/not operator

The is operator indicates whether the first of two operands is in the category of the second. The not operator indicates the opposite, that is, whether the first operand is not in the category of the second. The meaning of the operator depends on the left side of the comparison.

Syntax

Syntax diagram for the is/not operator
testExpression
A field in a record or form, sysVar.systemType, a record variable, or an array of record variables.
keyword
A keyword appropriate to the left side of the comparison. For details on sysVar.systemType keywords, see systemType; for fields and records, see the following categories.

Record fields

Use the following keywords for comparison to a field name in any type of record or in a form:
blanks
A TRUE comparison means the text field on the left side of the comparison contains only blanks or nulls.
numeric
A TRUE comparison means the character field on the left side of the comparison contains only numeric characters.
Use the following keyword for comparison to a field name in an SQL record:
trunc
A TRUE comparison means non-blank or non-null characters were dropped from the text field on the left side of the comparison after the last read.
Note that as of Version 7.0, the is operator is no longer used in comparisons with the null keyword. Instead use the == operator.
Use the following keywords for comparison to a field name in a form:
cursor
A TRUE comparison means the screen cursor is in the field on the left side of the comparison.
data
A TRUE comparison means non-blank or non-null characters exist in the text field on the left side of the comparison.
modified
A TRUE comparison means the modified data tag has been set for field on the left side of the comparison.

Records

Use the is or not operator to check for I/O errors. If you are in V6 exception mode (see v60ExceptionCompatibility), you can compare a record (or record array) to both hard and soft errors. In normal exception mode, you can compare only to soft I/O errors; hard I/O errors will throw either a FileIOException (file I/O) or an SQLException (SQL I/O). For a complete list of I/O errors, see I/O error values.

Compatibility

Table 1. Compatibility considerations for the is/not operator
Platform Issue
JavaScript generation Only the following variations of the is and not operators are supported: use of sysVar.systemType and record-specific tests of blanks and numeric.

Feedback