4.18 Function Control Table
The function control table is a table that controls how and when the various functions within a process are used and the ordering sequence that the functions should be in when displayed on the process menu.
Every function defined in a process has an entry in the function control table. It is automatically created with default values when the function is created and cannot be removed. However it can be changed from its default values to suit the specific requirements of a user application of LANSA.
Every entry in the function control table contains the following elements:
- The name of the function to which the entry belongs.
- The description of the function to which the entry belongs.
- An indication of whether or not the function should be displayed on (and therefore directly accessible from) the process's main menu.
- The Sequence that the Function should be ordered in on the process menu when displayed.
- The name of the associated "default next function".
- A list of up to 20 "allowable next functions".
The function control table associated with a process called EXAMPLE which has 3 functions called FUNC1, FUNC2 and FUNC3 would look like this before any user changes were made to it:
Func Dis on Default
Name Desc Menu Next Func Allowable next funcs
FUNC1 Function 1 YES MENU *ANY
FUNC2 Function 2 YES MENU *ANY
FUNC3 Function 3 YES MENU *ANY
In the section that dealt with "Creating a new function" a list of "reserved" function names was mentioned. This was a list of function names that were "reserved" for internal LANSA use and could not be used as valid user created function names:
Name |
Reserved Meaning / Description |
MENU |
Display process main menu |
EXIT |
Exit from LANSA |
HELP |
Display process HELP text |
SELECT |
Select next function from list of allowable function |
EOJ |
End all batch processing |
RETRN |
Return control to calling process or function |
ERROR |
Abort process with an error |
*ANY |
Any function name |
Taking the function control table for process EXAMPLE and the list of reserved function names together it can be seen that what the table is actually specifying to LANSA is:
- When using FUNC1 the most common (or default) next function is to display the process's main menu.
- After using FUNC1 the user can go to any other function in the process.
- Exactly the same conditions apply to using FUNC2 and FUNC3.
- All of the functions are to appear on the process's main menu and are therefore directly and independently accessible from the menu.
However, if the function control table for process EXAMPLE was changed as follows:
Func Dis on Default
Name Desc Menu Next Func Allowable next funcs
FUNC1 Function 1 YES FUNC2 FUNC2
FUNC2 Function 2 NO FUNC3 FUNC3 FUNC1 SELECT
FUNC3 Function 3 NO MENU MENU
The following conditions now apply:
- Once FUNC1 is used it is only possible to go to FUNC2.
- In FUNC2 we can only go to FUNC3 or back to FUNC1 and the usual thing to do next is to go to FUNC3. In addition, the "reserved" function SELECT can be used. This will result in a list of the allowable next functions (FUNC1 and FUNC3) being displayed as a "sub menu". From this the user can select the desired next function.
- In FUNC3 we can only go back and re-display the process's main menu.
- Only FUNC1 is to appear on the process's main menu. Thus only FUNC1 can be accessed from the process main menu. FUNC2 can only be accessed from FUNC1 and FUNC3 can only be accessed if FUNC2 (and therefore FUNC1) have been accessed first.
Hopefully this example illustrates the main purpose of the function control table which is to provide a "path" through the functions.
The path may be "enforced" (e.g.: From FUNC1 you must go to FUNC2) or it may be "suggested" (e.g.: from FUNC2 you would normally go to FUNC3, but can go to FUNC1 if desired).