HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
Chapter 4 133
Advanced Forms Design
Statement Syntax
Conditional Statement
IF [
value
]
editstatement
THEN [
statement
]...
[
statement
]...
[ELSE [
statement
]...
[
statement
]...
Control Statement
FAIL [“
msg
”] STOP
Operands
Whenever value is specified as an operand in a field processing statement, a field name,
constant, expression, or a save field name can be used. If the operand is numeric, any of
these can be combined into an arithmetic expression whose result is used as the operand.
Another operand, index, is used to retrieve items from a list by an index value. It must be
enclosed within parentheses in edit statements; in SET and CHANGE statements, it can be
specified without the enclosing parentheses.
Field
The name of any existing field within the same form can be specified as a value operand.
When a field name is specified, the value in that field at run-time is used to check the
current field.
A field name in an editing statement must describe a field of the same data type (character,
numeric, or date) as the current field.
Constant
Constants are divided into categories corresponding to the three main data types:
character, numeric and date. In addition, there are four system defined constants:
$EMPTY equivalent to all blanks; in comparison, $EMPTY is less than any other
value (any data type).
$LENGTH equivalent to the length of the field the last time the form was compiled
(numeric data types).
$STATE equivalent to a table of constants each of which is a two-character upper or
lowercase United States state or territory code; refer to Appendix F for the
codes (character type; used only in table checks).
$TODAY equivalent to today's date in the form dd/dd/dd where the order of month
day year is determined by the field type (date type only).