Download User Manual
Transcript
>define
>define
>if
short, 1,10
long ,11,15
short = long
{ten character field}
{fifteen character field}
In this example, Suprtool compares the ten bytes in the short field with the first ten
bytes of the long field, but ignores the last five bytes of the long field. If the
expression on either side of the equal sign consisted of more than one field (using the
+ operator) or involved any of the string functions, ($upper, $lower, $trim, $ltrim or
$rtrim), Suprtool would have compared both sides of the equal sign by padding the
shorter field with spaces. It is only the case where you are directly comparing one
byte-type field to another that Suprtool uses the length of the shortest field for the
comparison.
You cannot compare a byte-field to a numeric-type field. If you have a byte-field that
consists entirely of numeric digits, redefine the field as a display-type and use the
redefined field name in the If command.
Character Type
Byte-type fields can also be checked to see whether they contain only Alpha,
Numeric, Alphanumeric, or Special characters. The complete field is compared
against the specified character types.
Type
Characters
Alpha
A-Z, a-z (52 characters)
Numeric
0-9 (10 characters)
Special
anything else (194 characters, including
spaces, punctuation, Roman-8 letters, binary
junk)
Alphanumeric
A-Z, a-z, 0-9 (62 characters)
For the test result to be true, all the characters in the field must be of the specified
character type. To test a substring, use the Define command to define a subfield.
>if field = alpha
>if field <> numeric
Examples:
String
Class
"1234"
numeric
"12.3"
no class, contains both numeric and special
"ABCD"
alpha
"B JONES"
no class, contains both alpha and special
"
special
"
"A1B2"
alphanumeric
Pattern Matching
Suprtool can also select records based on a pattern of characters, rather than an exact
string of characters. For example, use the following to select all records with
"CONNOR" anywhere in the Name field,
Suprtool/Open 5.7
Suprtool Commands • 145