EMS Manual
Compiled Filters
EMS Manual—426909-005
5-21
Comparisons
As shown in Table 5-2, the filter language associates many token data types with four
EMF data types: signed, unsigned, string, and file name.
For comparison all token values and field values are treated as one of these four types.
The filter language treats many token data types as unsigned values. Because of the
internal structure of such data types, it is not meaningful to use most EMF comparison-
operators, such as <, to compare values of many token data types. For example, it is
not meaningful to say one subsystem ID is less than another. Therefore, the filter
language treats such values as unsigned, which lets you use them in equal (=) and not
equal (<>) comparisons.
Comparisons are defined for all EMF data types.
The values that correspond to one or more of the operands in a comparison can be
missing. For information on how the filter treats such comparisons, see Comparisons
With Missing Values on page 5-25.
File-name comparisons with equal (=) and not equal (<>) operators are treated as a
special case. For details, see Comparing File Names on page 5-23. The compiler
issues a warning for comparisons of file names with operators other than equal or not
equal, and treats such comparisons as string comparisons, using the internal form of
the file names. For more information, see Comparing Strings on page 5-22.
Comparing Values Within an EMF Data Type
Within an EMF (EMS filter) data type, you can compare token value with token value
and token value with constant. For example, token values of INT, INT2, INT4,
BOOLEAN, and ENUM can be compared with each other because they belong to one
EMF data type: signed. Within an EMF data type the filter performs conversions
automatically.
Certain comparisons within an EMF data type make sense, but others are
meaningless. For example, to compare two tokens of type ZSPI^TYP^ERROR for
equality makes sense in certain contexts. To make a less-than comparison between
those tokens or between two tokens that are both unsigned but have different token
data types might be meaningless.
Comparing Values With Different EMF Data Types
You can compare two tokens only if their EMF (EMS filter) data types agree. For
example, you cannot compare a ZSPI^TYP^INT type token (signed) with a
ZSPI^TYP^UINT type token (unsigned). You can compare a ZSPI^TYP^INT type token
to a ZSPI^TYP^ENUM type token because they have the same EMF data type: signed.
In many cases, you can compare a token value to a constant of another EMF data
type. The filter language converts the constant, when reasonable, to the EMF type of
the token to which it is compared. Conversion of this kind is possible between signed
and unsigned values and between string and file-name values. Conversion of this kind