You are here: Development Standards > Routines > General Routines > GENUSRFM.PUB

# GENUSRFM.PUB

GENUSRFM.PUB is a public program that allows the user to add or view user defined fields that are set up for a given master file. Use this program if you have set up a separate file that will hold user-defined fields for any file you have.

`0050 USERFIELDS:`
`0055 ENTER FILE[ALL],USR_DEF$,OSGUI$,PROMPT_NUM`

Variable | Description
FILE[ALL] | Standard file array.
USER_DEF$ | Template containing setup information for this function.
OSGUI$ | GUI Template (see GENGURES.PUB for more information).
PROMPT_NUM | Number of screen prompts for key fields.

Exit Points | Explanation
EXIT | GENUSRFM.PUB does not return any errors.

This chart breaks down the USER_DEF$ template:

Field | Description
MAINT:C(1) | Set to “Y” if the function is to allow for edits.
INQUIRY:C(1) | Not used.
FILNAM:C(4) | File name used with which field definitions are stored.
MASTER[x]:N(2) | FILE[x] array on which the master file for xxUD file is opened.
TEMPLATE[x]:C(8) | Name of the template that the master file for xxUD is using.
DOC:N(2) | FILE[x] array element on which the xxUD file is opened.
TITLE:C(70) | The title that appears on the view screen.
USRTEMPL:C(8) | The name of the template for the xxUF file to use.
LABEL[x]:C(20) | Label that appears for each prompt.
ID[x]:C(20) | Data that appears for each prompt.
IDNAME[x]:C(20) | Not used.
NAME[x]:C(20) | Name of the field within TEMPLATE[x] that holds the data for this key field.
TASK:C(1) | Returns “X” if the user presses F5 to abandon the function, “N” if the user presses D (for Done); “S” if the user presses Page Up, or “M” if the user presses F7 to exit the function.
WINDID[x]:C(9) | Name of the F2 window to use when inquiring on this key field.
SELVAL[x]:C(20) | SELVAL used with the F2 window to use when inquiring on this key field.
TMP[x]:C(50) | Holds an expression used to print the data that appears on the screen.
TMP2[x]:C(50) | Holds an expression used to read data from the file opened on MASTER[x].

Note: The number passed in PROMPT_NUM determines how many prompt fields appear on the screen, and is used to prepare the USER_DEF$ template.

When setting up to use this program, you can call GENUSRFM.PUB to have the USER_DEF$ template set up for you. The template USER_DEF$ has its arrays dimensioned to the number you pass in PROMPT_NUM.

`5905 SET_TEMPLATE:`
`5907 SETERR GENERROR`
`5910 ENTER USER_DEF$,PROMPT_NUM`