Enform Plus Reference Manual
Enform Plus Language Elements
Enform Plus Reference Manual—422684-001
3-26
Pattern-Match in Logical Expressions
Pattern-Match in Logical Expressions
In a logical expression, a field described as alphanumeric in the data dictionary can be
compared to a pattern-match. A pattern-match is actually a comparison template that the
field value is compared to. In the following logical expression, the partname field is
compared to a pattern-match:
partname = [-"DISK" - "MB"-],
OR partname = [-"DISK"-"Mb"-],
OR partname = [-"Disk"-"MB"-],
OR partname = [-"Disk"-"Mb"-],
In the following logical expression, two numbers precede the string-literal,
indicating that at least one character but no more than two characters must precede
string-literal in the field value:
partname EQ [1,2 "T"-],
IF/THEN/ELSE Expressions
IF/THEN/ELSE expressions yield a value determined by the result of a logical
expression. IF/THEN/ELSE expressions can be used wherever an arithmetic
expression can be used. IF/THEN/ELSE expressions can be nested. The syntax of an
IF/THEN/ELSE expression is as follows:
logical-expression
is a logical expression that evaluates as true or false.
value-1 or value-2
is a field name, an arithmetic expression, or IF/THEN/ELSE expression, or one of
the following value keywords: NULL, BLANK, BLANKS, ZERO, ZEROS.
If the logical expression is evaluated as true, value-1 is used. If the logical expression is
evaluated as false, value-2 is used. Value-1 and value-2 must be the same data type,
either both numeric or both alphanumeric.
The value keywords NULL, BLANK, and BLANKS print blanks on reports. The value
keywords ZERO and ZEROS print zeros on reports.
Consider the following IF/THEN/ELSE expression:
IF partnum = 2001 THEN ZEROS ELSE partnum,
This expression specifies that if partnum is equal to 2001, then zeros are to be printed
on the report. If partnum has any other value except 2001, the value of partnum is
printed.
(IF logical-expression THEN value-1 ELSE value-2)