Form example: stocklist.per

The stocklist.per form specification file contains a TABLE container and screen array used to display a list of stock rows.

The stocklist.per form file:
  1 SCHEMA custdemo
  2 
  3 LAYOUT (TEXT="Stock",WINDOWSTYLE="dialog")
  4 TABLE
  5 {
  6 [f1     |f2                                          ]
  7 [f1     |f2                                          ]
  8 [f1     |f2                                          ]
  9 [f1     |f2                                          ]
 10 }
 11 END
 12 END
 13 
 14 TABLES
 15 stock
 16 END
 17 
 18 ATTRIBUTES
 19 EDIT f1 = stock.stock_num, TITLE="Id";
 20 EDIT f2 = stock.description, TITLE="Description";
 21 END
 22 
 23 INSTRUCTIONS
 24 SCREEN RECORD sa_stock(stock.*);
 25 END
Note:
  • Line 1 defines the database schema to be used for this form specification file.
  • Lines 3 thru 12 define the LAYOUT section of the form with a TABLE container.
  • Lines 3 defines the LAYOUT block with a WINDOWSTYLE attribute set to "dialog": This points to the style attribute defined in the FGLDIR/lib/default.4st file, to get a modal window.
  • Lines 14 thru 15 declare the use of the stock SQL table definition of the custdemo schema.
  • Lines 18 thru 21 declare form field attributes for the table columns.
  • Lines 23 thru 25 define the form instructions.
  • Line 24 declares the sa_stock screen array, used to group form fields that define the TABLE columns.