HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
Chapter 4 149
Advanced Forms Design
RANGE CHECKS
RANGE CHECKS
Used to check whether the field value is within, or is not within, a specified range of
values.
Syntax
[{IN
NIN}
lowvalue
:
highvalue
[,
lowvalue
:
highvalue
]… ["
message
"]]
Parameters
value
The value can be a field, constant, save field, or a numeric expression, or it
may be an index retrieve operand within parentheses.
message
Specifies a custom error message.
Discussion
Range checks are similar to table checks except that you specify a list of ranges rather
than a list of exact values. The range is inclusive, that is the field value must be within the
range that includes the lowvalue and the highvalue.
The low and high values may be any combination of field names, constants, save fields,
arithmetic expressions, or index retrieve operands. As with table checks, an implicit OR is
understood between the ranges in the list. Thus, the statement can be interpreted as:
Is current value in (IN) range1
OR
range2
OR
...
Is current value not within (NIN) range1
NOR
range2
NOR
...
The low value must not be greater than the high value. If it is, an error is issued when the
form is executed (not when it is compiled).
Example
NIN 12:45 Current numeric value must not have any value between
12 and 45 inclusive.
IN F2/2:F2*2 The field can have any numeric value ranging from half
the value in field F2 through twice the value in F2. Note
that the current field and F2 must be numeric in order to
use an arithmetic expression in the range check.
IN $TODAY:! 12/12/99! Any date between today's date and December 12, 1999
may be entered.
Range and table checks can be combined in one statement, as illustrated in the following
examples:
NIN -12.5:-2,25, 1000:FIELD3 Value may NOT be in range -12.5 through -2, nor
equal to 25, nor in the range from 1000 through the
current value of FIELD3.