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

# GENSTDOC.PUB

GENSTDOC.PUB is a public program used to start up documents from applications. Users can set up documents for a variety of master files, including customers, vendors, and employees. To launch those documents, this routine is called so that documented are started in a consisten manner from within OSAS.

`0060 ENTER FILE[ALL],PATH$,FILE$,MENUPATH$,MSG$`

Variable | Description
FILE[ALL] | Standard file array.
PATH$ | Path where document exists. This is optional starting in 7.6.
FILE$ | Document file to open. This can contain the entire path, starting in 7.6.
MENUPATH$ | Set only from menu programs to path in XXMN file when launching documents from menus
MSG$ | Error message returned from GENSTDOC.PUB

Exit Points | Explanation
EXIT | GENSTDOC.PUB does not return any errors.
EXIT ERR | GENSTDOC.PUB returns error message in MSG$

This routine performs the following when opening up a document:

- Opens the OSFT file to determine the form type of the document, if one exists.
- Attempts to open the function used to start a document as defined by the OSFT file. If that can’t be found, the OS default start command is used instead.
- Attempts to open the document to be opened based on the PATH$, FILE$, and MENUPATH$ variables. If the document is found, it’s launched via the OSFT program or the OS default start program.