menu_banner.gif Main Index  PREV  NEXT

Valid HTML 4.01!   Valid CSS!

Appendix I: Initial Values

For those components which add new occurrences to the database it is possible for initial values to be defined in the menu database instead of being hard-coded within the program code. This means that the initial values can be changed very easily.

Initial values are loaded into new occurrences before they are first displayed to the user, but they can be changed at any time.

In order for a component to accept initial values it must contain the following code:

  1. It must have a component variable called $INIT_VALUES$.
  2. It must have code similar to the following in the <exec> trigger
    params
       string  $params$    : IN
    endparams
    
    getlistitems/id/component $params$     ; copy to component variables
    
  3. It must have code similar to the following in the <occurrence gets focus> trigger of the entity in question:-
    if (!$dbocc) & (!$occmod)      ; record is new & unmodified
       call LOAD_INIT_VALUES($init_values$)
       #include STD:FATAL_ERROR
    endif
    

Any initial values that are required must be added to the menu database using transaction MNU_0080M.

When the component is initiated using the standard global proc ACTIVATE_PROC the following will take place:-

The following keywords will be converted by proc LOAD_INIT_VALUES at run time:-

Note that it is possible to create another version of the component with an alternative transaction identity so that a different set of initial values can be defined for each Transaction ID.


copyright.gif http://www.tonymarston.net