Was this helpful?
StdList Function
The StdList function is a 4GL procedure that builds and returns a ChoiceList of month names, weekday names, state names, or values from a column in a database table.
This function has the following syntax:
ChoiceList = StdList(Type = 'type',   /* Type of list requested */
        TblName = 'name',     /* Optional table name */
        ColName = 'name')     /* Optional column name */
Arguments
Data Type
Description
Type
Varchar(65)
Specifies one of the following:
months—Specifies a list of month names (1–12, January to December)
weekdays—Specifies a list of weekday names (1–7, Sunday to Saturday)
states—Specifies a list of state names (1–50, Alabama to Wyoming)
query—Specifies a list of values from table TblName, column ColName
TblName
Varchar(65)
Parameter that contains the name of the table to be used when Type='query'
ColName
Varchar(65)
Parameter that contains the name of a column to be used when Type='query'
This function returns the ChoiceList—the list of requested strings.
Example—StdList function:
declare
    NewList = ChoiceList default null;
enddeclare
begin
    /* Build a list of weekday names */
    NewList = StdList(Type = 'weekdays');
    /* Build a list of month names */
    NewList = StdList(Type = 'months');
    /* Build a list of state names */
    NewList = StdList(Type = 'states');
    /* Build a list of values from a column in a table */
    NewList = StdList(Type = 'query',
                      TblName = 'department',
                      ColName = 'dept_name');
end
Last modified date: 06/25/2024