Telling the AVM how to continue processing
- Last Updated: March 30, 2020
- 3 minute read
- OpenEdge
- Version 12.2
- Documentation
When you modify a field or variable, pressing GO tells the AVM to accept the data in all the modified fields and variables in the current statement and to go on to the next statement in the procedure.
As the following figure shows, if you press GO while the cursor is in the name,
credit–limit, or sales–rep fields, the AVM continues
on to the next statement in the procedure, which is END.
The procedure then returns to the beginning of the FOR EACH loop.
i-intro.p

You might want to define function keys that tell the AVM to continue processing
data a certain way. You can use the GO–ON phrase
with the SET or UPDATE statement
to do this, as shown in the i-gon1.p procedure.
i-gon1.p
|
In this example, if the user presses F8, F10, or F12 while updating the customer data, the procedure immediately goes on to the next statement in the procedure. Let's take a closer look at this procedure.
Any key you can press while running an ABL procedure has a code,
a function, and a label associated with it. The code of a key is
an integer value that the AVM uses to identify that key. For example,
the code of F1 is 301. The function
of a key is the work that the AVM does when you press the key. For example,
the function of the F1 key may be HELP. The
label of a key is the actual label that appears on the keyboard
key. The label of the F1 key is
F1.
As shown earlier, you can use the KEYLABEL, KEYCODE, KEYFUNCTION,
and KBLABEL functions to convert key labels, key
codes, and key functions. In addition to these functions, the LASTKEY function
returns the key code of the last key pressed.
You can use the functions described in this table to monitor the keys being pressed, as in the i-keys.p procedure.
i-keys.p
|
Run procedure i-keys.p to see how the different keys you press translate into key codes, key labels, and key functions.
Now, run the i-gon1.p procedure. A screen similar to the one shown in the following figure appears.

While updating the customer information, press F9, F10, F11, or use either of the standard
techniques to signal the end of data entry, the AVM goes on to the
next statement in the procedure. If you press any other key, the
AVM does not continue on to the next statement in the procedure,
but instead performs the data entry operation associated with that
key. If you press END-ERROR, the
AVM performs the default ENDKEY processing of UNDO, LEAVE.
If the AVM does continue on to the next statement in the procedure,
the CASE statement determines the action to take
by checking the value of the last key pressed.
The procedure i-gon2.p shows how you can achieve the same functionality in an event-driven application.
i-gon2.p
|
Use the ANYWHERE option of the ON statement
to set up triggers that execute no matter which widget has input
focus. In i-gon2.p, the ANYWHERE option
is used to assign triggers to function keys.
ANYWHERE trigger.