# ON ... GOSUB/GOTO/EVENT Directives

> Source: https://manual.pvxplus.com/directives/on

The **ON** directive has four formats: two that provide condition execution based on the value of a numeric expression, one that is used to define how to process EVENTS from OCX controls, and a fourth to define structured Error handling.

## Formats

Use these links to access additional information for a ***specific*** format:

| **Format** | **Description** |
| --- | --- |
| [ON numexpr GOSUB stmtref,...](https://manual.pvxplus.com/directives/on-gosub) | Jump to a subroutine value based on the value of a numeric expression. |
| [ON numexpr GOTO stmtref,...](https://manual.pvxplus.com/directives/on-goto) | Transfer control to a statement value based on the value of a numeric expression. |
| [ON EVENT...](https://manual.pvxplus.com/directives/on-event) | Control the processing of events as received from external controls. COM, .NET and \*Browser controls are supported. See **[DEF OBJECT](https://manual.pvxplus.com/directives/def-object)** directive.<br>*(.NET support was added in PxPlus 2025.)* |
| [ON PROCESS EVENT...](https://manual.pvxplus.com/directives/on-event) | Define the logic to be executed when a [PROCESS EVENT](https://manual.pvxplus.com/directives/processevents) directive is executed.<br>*(The PROCESS EVENT directive was added in PxPlus v11.00.)* |
| [... ON ERR directive(s)...](https://manual.pvxplus.com/directives/on-err) | Define Error logic for GOSUB, WHILE, FOR, REPEAT and SELECT directives. |
