INCLUDE attribute

The INCLUDE attribute defines a list of possible values for a field.

Syntax

INCLUDE = ( { NULL | literal [ TO literal] } [,...] )
  1. literal can be any literal expression supported by the form compiler.

Usage

The INCLUDE attribute specifies acceptable values for a field and causes the runtime system to check the data before accepting an input value.

If the field is FORMONLY, you must also specify a data type when you assign the INCLUDE attribute to a field.

Include the NULL keyword in the value list to specify that it is acceptable for the user to leave the field without entering any value.

Use the TO keyword to specify an inclusive range of acceptable values. When specifying a range of values, the lower value must appear first. The field value is accepted if it is greater or equal to the first literal, and lower or equal to the second literal.

INCLUDE = (1 TO 999)
  is equivalent to:
( field_value >= 1 AND field_value <= 999 )

Special consideration must be taken for character string fields:

INCLUDE = ("AAA" TO "ZZZ")
  is equivalent to:
( field_value >= "AAA" AND field_value <= "ZZZ" )
  ABC is accepted
  A!! is not accepted
  Zaa is not accepted
When combining several ranges and single values, the value entered by the user is verified for each element of the INCLUDE attribute:
INCLUDE = (1 TO 999, -1, NULL)
  is equivalent to:
( field_value >= 1 AND field_value <= 999 )
OR
( field_value == -1 )
OR
( field_value IS NULL )

Example

EDIT f001 = compute.rate, INCLUDE = ( 1 TO 100, 200, NULL);
EDIT f002 = customer.state, INCLUDE = ( "AL" TO "GA", "IA" TO "WY" );
EDIT f003 = FORMONLY.valid TYPE CHAR, INCLUDE = ("Y","N");