Example 4: Set display attributes for cells

 FUNCTION display_customer()
   DEFINE i INTEGER
   DEFINE arr DYNAMIC ARRAY OF RECORD
                key INTEGER,
                name CHAR(10)
              END RECORD
   DEFINE att DYNAMIC ARRAY OF RECORD
                key STRING,
                name STRING
              END RECORD

   FOR i=1 TO 10
     CALL arr.appendElement()
     LET arr[i].key = i 
     LET arr[i].name = "name " || i 
     CALL att.appendElement()
     IF i MOD 2 = 0 THEN
       LET att[i].key = "red"
       LET att[i].name = "blue reverse"
     ELSE
       LET att[i].key = "green"
       LET att[i].name = "magenta reverse"
     END IF
   END FOR

   DIALOG ATTRIBUTES(UNBUFFERED)
     DISPLAY ARRAY arr TO sr.*
       ON ACTION att_attach 
         CALL DIALOG.setArrayAttributes("sr", att)
       ON ACTION att_detach 
         CALL DIALOG.setArrayAttributes("sr", NULL)
       ON ACTION att_modify_cell 
         LET att[2].key = "red reverse"
       ON ACTION att_clear_cell 
         LET att[2].key = NULL
     END DISPLAY
   END DIALOG

 END FUNCTION