Structured ARRAYs in list dialogs
ARRAYs with sub-records can be used in list dialogs, to simplify array definition based on database tables, requiring additional information at runtime.
Starting with Genero version 3.00, ARRAY
variables defined with sub-records can
be bound to DISPLAY ARRAY and INPUT ARRAY screen records.
This is especially useful when you need to define arrays from database tables, and handle
additional row information at runtime, for example, to hold an image resource for each row, to be
displayed with the IMAGECOLUMN
attribute.
An array is usually defined with a flat list of members:
SCHEMA shop
DEFINE a_items DYNAMIC ARRAY OF RECORD LIKE items.*
...
With version 3.00, arrays structured with sub-records can now be used within a
DISPLAY ARRAY
or INPUT ARRAY
dialog. The
array members and the form fields used by the screen array are bound by
position:
SCHEMA shop
DEFINE a_items DYNAMIC ARRAY OF RECORD
item_data RECORD LIKE items.*,
it_image STRING,
it_count INTEGER
END RECORD
...
DISPLAY ARRAY a_items TO sr.*
...
For more details about program variable to form field binding in dialogs, see Binding variables to form fields, Example 4: DISPLAY ARRAY with structured array.