Working with Arrays of Dialog Elements

It is sometimes convenient to arrange dialog elements in one or two dimensions. If, for example, you want to arrange several radio button controls in one column, it is possible to draw the first one and specify the others as a one-dimensional array.

Start of instruction setTo work with arrays of dialog elements

  1. Choose the Array button in the radio button control's attributes window. The Array Specification dialog box appears.

  2. Enter:

    • the number of dimensions;

    • the bounds of the first and second dimension, if applicable;

    • the spacing on the x and y axis in pixels (depending on whether the array is arranged in rows or in columns);

    • the arrangement (rows or columns).

The array will now be treated as a graphical entity. Note that you will have to assign a common GROUP-ID attribute to each radio button control. This will enable you to treat the array as a logical entity.

For each dialog element in an array, the following attributes may be specified separately:

In an event handler for an array of dialog elements, the system variable *CONTROL will denote one of the array elements.

If a variable is selected as the source of an attribute value, the array must contain at least the index ranges of the dialog element.

If a message file ID is specified as the source of an attribute value, consecutive messages are taken for the array's sequence of dialog elements.

In an array of dialog elements, you can assign one value to all dialog elements in the array using the (*) notation or a range, such as in the following examples:

#PB-1.ENABLED(*) := TRUE    /*invalid 
#PB-1.ENABLED(1:3) := TRUE  /*invalid

An alternative way of creating a sequence of identical dialog elements is to duplicate or copy and paste an individual dialog element and use the grid plus the cross-hair cursor to place them.

The following example illustrates how to set the STRING attribute of occurrence 2 in a one-dimensional push button array:

#PB-2.STRING(2) := 'HUGO'