You are here: Development Standards > Routines > General Routines > GENLIST

# GENLIST

GENLIST is a general routine that contains a multiline function called FNLIST. This function takes a control ID, a string, a list of possible values, and a string length, and based on that information, will select a value from a list box based on the information. GENLIST occupies lines 18900–18950 and should be merged into all programs that have list buttons on a GUI screen.

Variable | Description
ID | Control ID of list button
PARAM$ | String to display on screen
LIST$ | List of all strings to populate button
LEN | Length of each string, equal to X4

To use GENLIST, add a line in the GUI_DATA section where a selection value from a toggle option would normally print in the DATA section of code. For example, if the code in the data block reads like this:

`7750 PRINT @(47,12),CALCFIN$`

its GUI counterpart would read as follows:

`17750 LET TMP=FNLIST(4030,CALCFIN$,"Invoice DateDue Date ",12)`

Notice that you must pass all possible options for the toggle and the length of each option in order for GENLIST to determine where the value comes from. This is necessary in order to make the proper selection in the GUI list button.