ui.Dialog.setArrayAttributes

Define cell decoration attributes array for the specified list (singular or multiple dialogs).

Syntax

setArrayAttributes(
   name STRING,
   attributes ARRAY )
  1. name is the screen array name.
  2. attributes is a program array defining the cell attributes.

Usage

In an INPUT ARRAY or DISPLAY ARRAY dialog, the setArrayAttributes() method can be used to specify display attributes for each cell.

Important: This feature is not supported on mobile platforms.

The setArrayAttributes() when several screen arrays are defined, to be able to idenfify the list by the name of the screen array. An equivalent method called setCellAttributes() can be used, for dialogs where only one screen array is defined.

Possible values for cell attributes are a combination of the following:

Define an array with the same number of record elements as the data array used by the INPUT ARRAY or DISPLAY ARRAY. Each element must have the same name as in the data array, and must be defined with a character data type (typically: STRING):
DEFINE data DYNAMIC ARRAY OF RECORD
         pkey INTEGER,
         name VARCHAR(50)
       END RECORD
DEIFNE attributes DYNAMIC ARRAY OF RECORD
         pkey STRING,
         name STRING
       END RECORD
Fill the display attributes array with color and video attributes. These must be specified in lowercase characters and separated by a blank (ex: "red reverse"):
FOR i=1 TO data.getLength()  -- length from data array!
    LET attributes[i].name = "blue reverse"
END FOR
Then, attach the array to the dialog with the setArrayAttributes() method, in a BEFORE DIALOG, BEFORE INPUT or BEFORE DISPLAY block:
BEFORE DIALOG
   CALL DIALOG.setArrayAttributes( "sr", attributes )
Like data values, if you change the cell attributes during the dialog, these are not displayed automatically unless the UNBUFFERED mode is used.
ON ACTION modify_cell_attribute 
   LET attributes[arr_curr()].name = "red reverse"
If you set NULL to a element, the default TTY attributes will be reset:
ON ACTION clean_cell_attribute 
   LET attributes[arr_curr()].name = NULL