AREV32 startup process (General)
Created at 22 MAY 2008 11:27AM
When the AREV32_CHILD_FORM or AREV32_STANDALONE_FORM is invoked (or when the command AREV32 is issued in CTO at TCL), a series of records are checked to control which commands and menus are run. It is important to understand the order in which these records are examined.
If the AREV32 command is issued with an explicit command to run (for example,typing "AREV32 RUN MENU STARTUP" at CTO TCL), then that specific command or menu is run, and AREV32 then terminates.
If no explicit command is specified, the AREV32 process will attempt to find any"startup" command and/or "reset" command defined for this application or user. The"startup" command is issued before any other AREV32 processing; this may be done, for example, to attach tables, volumes, etc. The "reset" command identifies which menu (typically) should be used as the 'main menu' for this AREV32 session.
First, the SYSENV table is checked for a record with the same name as the current user. If this record exists, and field 1 of the record is the literal string "USER", and field 2 of the record is the name of the current application, then any value in field 3 is used as the "startup" command, and any value in field 8 is used as the"reset" command.
Next, the SYSENV table is checked for a record with the same name as the current application. If this record exists, and field 1 of the record is the literal string "ACCOUNT", then any value in field 2 is used as the "startup" command IF NO STARTUP COMMAND HAS PREVIOUSLY BEEN FOUND, and any value in field 10 is used as the"reset" command IF NO RESET COMMAND HAS PREVIOUSLY BEEN FOUND.
If no "reset" command has been defined at this point, the current environment set (@environ_set) is checked (in the E.MENU field); if any value exists in this field, then the "reset"routine is set to the menu named STARTUP.
The VOC table is then checked for a record with the same name as the current user. If this record exists, then the"startup" command is set to the user name (so that the VOC entry - a cataloged pointer, a PROC or paragraph, etc. - will be run) IF NO STARTUP COMMAND HAS PREVIOUSLY BEEN FOUND.
Next, the VOC table is checked for a record with the same name as the current application, and (as above) the "startup" command is set to the application name IF NO STARTUP COMMAND HAS PREVIOUSLY BEEN FOUND.
Finally, the VOC table is checked for a record with the name LOGON. If this record exists, and there is no"reset" or "startup" routines defined, the "startup" command is set to LOGON.
At this point, processing is ready to proceed. If there is a command defined for the "startup" processing, it is executed. After it has completed, the main processing loop (RTP18) is entered, and any defined "reset"command is evaluated.