ADD-ITEMS-EX Action

This document covers the following topics:


Description

Adds list box items in a List Box Control and selection box items in a Selection Box Control. Associates data to the items either as CLIENT-KEY/CLIENT-VALUE pairs or as CLIENT-DATA values. The item strings and the corresponding data can be specified either as single values or as one-dimensional arrays. Both strings and data must be provided in the same way. If the parameter "Client key" is blank, each data value is entered as the CLIENT-DATA of the corresponding item. If it is not blank, it is entered as the CLIENT-VALUE with the corresponding CLIENT-KEY.

Parameters

Name/Data Type Explanation
HANDLE OF dialog element Input

Specifies a dialog element.

Number of Items (I4) Input
Client key (A253) Input

CLIENT-KEY attribute to be used for each value in the list of values.

String list (A253) Input

A number of alphanumeric variables or constants or an array specification.These strings are entered in the STRING attribute of each item. You may only use a one-dimensional array in the array specification. Using part of a higher-level array causes an error.

Value list (A253 or I4) Input

A number of alphanumeric variables or constants or an array specification.These are interpreted as the CLIENT-VALUE of the given CLIENT-KEY. If the CLIENT-KEY value is blank, the value list is entered in the CLIENT-DATA.

Response (I4) Output

Natural error (if applicable).

Example:

 
   /* Definitions in the dialog's local data area: 
   1 #NUMBER (N4) 
   1 #CITY (A20/1:2) 
   1 #CODE (I4/1:2) 
   1 #KEY (A20) 
   ... 
   /* Event handler code: 
   #NUMBER:= 2 
   #CITY(1):= 'Berlin'  
   #CODE(1):= 1015 
   #CITY(2):= 'Munich' 
   #CODE(2):= 8053 
   #KEY:= 'Code' 
   PROCESS GUI ACTION ADD-ITEMS-EX 
   WITH #LB-1 #NUMBER #KEY #CITY(1) #CITY(2) #CODE(1) #CODE(2) GIVING #RESPONSE 
   /*  Another possible WITH clause (same result) 
   WITH #LB-1 #NUMBER #KEY #CITY(1:2) #CODE(1:2) GIVING #RESPONSE