main
''
''    AUTHOR: Steve Bailey
''    CREATED: 9-8-93
''    DESCRIPTION:
''      This program shows some of the forms enhancements in SIMGRAPHICS II.
''

    define ICONS.FORM as a pointer variable
    define FIELD.ID as a text variable
    define NUM.ITEMS as an integer variable
    define ITEMS as a 1-dim text array

    show ICONS.FORM with "iconlist.frm"

    '' readin the datafile containing list info
    open unit 1 for input, name is "iconlist.txt"
    use unit 1 for input
    
    '' first read in the number of lines, then create the array to hold
    '' item names
    read NUM.ITEMS
    reserve ITEMS(*) as NUM.ITEMS
    for I = 1 to NUM.ITEMS do
        read ITEMS(I)
    loop

    close unit 1

    let DARY.A(DFIELD.F("ICON_LIST", ICONS.FORM)) = ITEMS(*)

    '' bring up the dialog and wait for a terminating button click
    let FIELD.ID = ACCEPT.F(ICONS.FORM, 0)
    let FIELD.ID = FIELD.ID                             '' prevent warnings
end
