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

# GENVWDOC.PUB

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

DOCUMENTS:

This entry point will launch the documents maintenance and inquiry screen.

`0050 MAKE_WINDOW_MENU:`
`0055 ENTER FILE[ALL],USER_VWDOC$,OSGUI$,PROMPT_NUM`

Variable | Description
FILE[ALL] | Standard file array.
USER_VWDOC$ | 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 | GENVWDOC.PUB does not return any errors.

This chart breaks down the USER_VWDOC$ template:

Field | Description
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.
POS_KEY[x]:N(2) | Position within a string that the part of the master key is in, within the key string.
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.
DOCTEMPL:C(8) | The template for the base application’s xxUD file.
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” when 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_VWDOC$ template.

SET_TEMPLATE:

You can call GENVWDOC.PUB to have the USER_VWDOC$ template set up for you. The template USER_VWDOC$ has its arrays dimensioned to the number you pass in PROMPT_NUM.

`5905 SET_TEMPLATE:`
`5910 ENTER USER_VWDOC$,PROMPT_NUM`

Variable | Description
USER_VWDOC$ | Template containing setup information for this function.
PROMPT_NUM | Number of screen prompts for key fields.