3.3.3 Form Modes



Whenever the user pushes a function key that changes form's operational mode, form first checks that the mode is permitted (as specified in the command line) before calling the user edit routine. If the mode is permitted, and perhaps after several other checks are made, the user edit routine is called. If the user edit routine returns an error message, form displays the error message and the previous mode remains in effect. Otherwise, form switches to the new mode. The user edit routine is called each time the input mode changes so that the user edit routine can keep track of the current input mode if it desires.

Note that form calls your user_edit routine before it switches to the new mode; the user_edit call indicates form's intent to switch to the new mode and allows your user_edit routine to allow or disallow the mode switch.

Many of the user edit types can occur not only from the operator pressing a function key, but also from an internal action within form. For example, when the operator presses STORE while adding records in a sequence of non-repeating forms, form automatically goes to the next form and remains in ADD mode. The user edit routine would receive the following calls:

U_PREPARE

U_STORED

U_NEXTFORM

U_BEGINFORM

U_ADD