ITEMS attribute
The ITEMS
attribute defines a list of possible values that can
be used by the form item.
Syntax
ITEMS = { single-value-list | double-value-list }
( value [,...])
( ( value, label-value) [,...])
- single-value-list is a comma-separated list of single values.
- double-value-list is a comma-separated list of (a, b) values pairs within parentheses.
- value is a numeric or string literal, or one of the following keywords:
NULL
,TRUE
,FALSE
. - label-value is a numeric literal, a string literal, or a localized string.
Usage
The list must be delimited by parentheses, and each element of the list can be a simple literal value or a pair of literal values delimited by parentheses.
This attribute is not used by
the runtime system to validate the field, you must use the
INCLUDE
attribute to force the possible
values.
ITEMS = ("Paris", "London", "New York")
ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"))
COMBOBOX
form
item:COMBOBOX cb01 = FORMONLY.combobox01,
ITEMS = ((1,"Paris"), (2,"London"),(3,"New York"));
In this example, the first value of a pair (1,2,3) defines the data values of the form field and the second value of a pair ("Paris", "London", "New York") defines the value to be displayed in the selection list.
RADIOGROUP
form item, this attribute defines the list of radio
buttons:RADIOGROUP rg01 = FORMONLY.radiogroup01,
ITEMS = ((1,"Paris"), (2,"London"),(3,"New York"));
In this case, the first value of a pair (1,2,3) defines the data values of the form field and the second value of a pair ("Paris", "London", "New York") defines the value to be displayed as the radio button label.
ITEMS
= ((1,%"item1"),(2,%"item2"),(3,%"item3"))
NULL
value for an item (An empty string is equivalent
to NULL
):ITEMS
= ((NULL,"Enter bug status"),(1,"Open"),(2,"Resolved"))
In this case, the behavior of the field depends on the item type used.