# Directives

ON PROCESS EVENT | Define Internal Event Logic

## Formats

1. Define CALL to Handle Event: | ON PROCESS EVENT eventname$ [ REMOVE ] CALL program$
2. Define PERFORM to Handle Event: | ON PROCESS EVENT eventname$ [ REMOVE ] PERFORM program$

Where:

eventname$ | Name of the event that will trigger the execution of the logic (CALL or PERFORM invocation).
program$ | Name of the program (with option;label) that will be called or performed when the event is triggered.
REMOVE | Keyword that indicates the logic is to be removed.

## Description

This directive is used to define the action to be done when the event specified in eventname$ occurs. Possible actions include calling a program or performing a program.

The actual name of the event is up to the user and is case insensitive. Event names must be non-blank between 1 and 32 characters in length.

To remove an action, the programmer can specify the same CALL or PERFORM parameters used to add the event preceded by the keyword REMOVE. No error will be generated if the action/event specified does not exist.

(The ON PROCESS EVENT directive was added in PxPlus v11.00.)

## See Also

Event Handling
PROCESS EVENT Generate Internal Event