Logical expressions are special statements that evaluate to either TRUE or FALSE for use with the IF and WHILE conditional statements. Note that there is currently no way to directly represent a logical value in EASI. Logical expressions consist of comparisons between numeric and string expressions combined with the use of the logical operations AND, OR, and NOT.
There are two basic types of logical expressions which may be combined using Logical Relations:
The equality and inequality tests may be used with either two numeric expressions or two string expressions. When comparing two strings, the shorter is temporarily padded out with spaces and the comparison is case insensitive. The equal sign ("=") is used to test for equality, while inequality is tested with "<>" or "!=". For example:
if( name = "Frank" )then
...
if( size != 0 )then
...
while( flag <> 1 )
...
The "~=" operator is a regular expression matching test of equality for use between strings and tests whether the left side argument matches the right side regular expression. Note that the string comparison is case insensitive and length of string matters. Only "*" (multicharacter wildcard) and "?" (single character wildcard) operators are supported in the regular expression matching at this time. For example:
if( file_name ~= "*.pix" )then print "Apparently ",file_name," is a PCIDSK file." endif
The ">", "<", ">=" and "<=" operations may only be performed on numeric expressions and perform in the expected way. For example:
while( total <= 100 ) while( total < 101 ) while( NOT total > 100 ) while( NOT total >= 101 )
The logical operations AND and OR operate on two logical expressions, while NOT operates on one logical expression. The symbols "&", "|" and "!" are considered to be equivalent to AND, OR, and NOT. For example:
if( A = 1 AND B = 1 )then
...
endif
if( A = 1 & b = 1 )then
...
endif
For more detailed descripton of the EASI expressions please refer to the next few pages.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.