Simple test on field

<< Click to Display Table of Contents >>

Navigation:  User guide > Logic >

Simple test on field

test of field  - true if the field (range of data locations) contains:

field / literal                          code equivalent of the literal (exact match)

field / iconstant                  the value of the constant

field / iconstant1..iconstant2        any value in the range given (inclusive)

field / >iconstant                any value greater than the constant

field / <iconstant                any value less than the constant (or U)

field / B                          blank/empty (no codes)

field / S                          one (and only one) code on the entire field

field / M                          more than one code in the entire field

field / Cn                          exactly n codes in the entire field

When a field is being tested for a value (iconstant) it is first converted to a number using formats IFB, IFF, ADF and ANF. The number extracted is then used for the test. If the field contains a number with a decimal point, we recommend loading the value into a wvar first (with F=ADF) and then testing the wvar.

When a field is tested for a literal the number of characters in the literal should be the same as the number of data locations in the field unless RCP SHORTCHARTEST is used.

IMPORTANT: when testing fields, ivars, wvars, and cells for being less than a given value, U (undefined) is in fact a large negative number and will be included in any test using < (less than).

Examples of simple tests on fields:

$123-125/'PJK',

$1210-1212/12,

$101-105/1..20,

$247-250/>99,

$172-180/<6,

$201-280/b,

$9901-9908/c8,

$421-423/u,