HPlogo HP Data Entry and Forms Management System (VPLUS) Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 4 Advanced Forms Design

RANGE CHECKS

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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.

IN "ADE": "BB", "s", "t"

The field may have any value in the range ADE through BB or it can be s or t. Thus, it could be Abcd, or B or t, but it cannot be AB or S. In NATIVE-3000, all lowercase letters are greater than any uppercase letters.

IN "20":"30"

Allows any character values between 20 and 30 in the USASCII collating sequence. Thus 2A and 3& are valid for NATIVE-3000. (Other native languages use other collating sequences.)

Native Language Support

NATIVE-3000 must be used to define values for date and numeric fields within FORMSPEC. VPLUS will convert the value when the forms file is executed to be consistent with the native language selected. Range checks specified within FORMSPEC may contain any character in the 8-bit extended character set consistent with the selected language ID. When the form is executed the collating table for the native language specified is used to check whether the field is within range. For more information on Native Language Support, see Section 8.

Feedback to webmaster