Kbase P109677: 4GL: How to populate an EDITOR widget from an Array Field an array element per line?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/18/2007 |
|
Status: Verified
GOAL:
How to populate an EDITOR widget from an array field using an array element value per line?
FIX:
The following sample assumes that we do not want the "RETURN"; CHR(10); to be appended at the end of the last line inserted into the EDITOR. The code performs the followings tasks:
1. Finds the table record whose array field is to be used to populate the EDITOR widget.
2. Iterates as many times as the number of array elements in the field using the EXTENT function.
3. Inserts a line using the EDITOR's INSERT-STRING method with the corresponding array field element in each iteration.
DEFINE VARIABLE iCounter AS INTEGER NO-UNDO.
FIND FIRST MyTableRecordBuffer NO-LOCK.
DO iCounter = 1 TO EXTENT(cArrayField):
IF iCounter = EXTENT(cArrayField) THEN
EDITOR-1:INSERT-STRING(cArrayField[iCounter]) IN FRAME {&FRAME-NAME}.
ELSE
EDITOR-1:INSERT-STRING(cArrayField[iCounter] + CHR(10)) IN FRAME {&FRAME-NAME}.
END.