ui.Dialog.setArrayAttributes

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

Syntax

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

Usage

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

You must 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 (STRING).

An equivalent method to setArrayAttributes(), called setCellAttributes(program-array), takes only the program array as argument. The setCellAttributes() method is designed for singular dialogs, where only one screen array is used. You can however use the setArrayAttributes() in singular dialogs, for consistency.

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").

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

Then, pass the array to the dialog with the setArrayAttributes() method, in a BEFORE INPUT or BEFORE DISPLAY block. Display attributes can be changed dynamically during the dialog:
ON ACTION set_attributes 
  CALL DIALOG.setArrayAttributes( "sr", attarr )
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 attarr[index].col8 = "red reverse"
If you set NULL to a element, the default TTY attributes will be reset:
ON ACTION clean_cell_attribute 
  LET attarr[index].col8 = NULL
The cell attributes array can be detached from the dialog by passing NULL as second parameter to the setArrayAttributes() method. When doing this, the default TTY attributes will be reset (those defined by the window or dialog ATTRIBUTE clause):
ON ACTION remove_attributes 
  CALL DIALOG.setArrayAttributes( "sr", NULL )

For a complete example, see Example 4: Set display attributes for cells.