SEND EVENT

#### Search Results

Search

# SEND EVENT

`SEND EVENT` | operand1 `TO` [`DIALOG-ID`] |  | operand2 |  |  |  |  |  |  |
`*DIALOG-ID` |  |  |  |  |  |
|  |  | `WITH` |  | operand3 |  | (`AD=` |  | `M` `O` `A` |  | ) |  |  |  |  |
| n `X` |  |  |  |  |  |  |
| `USING` [`DIALOG`] 'dialog-name' WITH PARAMETERS-clause

This document covers the following topics:

- SEND EVENT Usage

- SEND EVENT Syntax Description

- Further Information and Examples

For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.

Related Statement: `OPEN DIALOG` | `CLOSE DIALOG` | `PROCESS GUI`

Belongs to Function Group: Event-Driven Programming

## SEND EVENT Usage

The `SEND EVENT` statement is used to trigger a user-defined event within a Natural application.

## SEND EVENT Syntax Description

Operand Definition Table:

Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition
--- | --- | --- | --- | ---
`operand1` | C | S |  |  |  | A |  |  |  |  |  |  |  |  |  |  |  |  | yes | no
`operand2` |  | S |  |  |  |  |  |  |  | I |  |  |  |  |  |  |  |  | yes | no
`operand3` | C | S | A |  |  | A |  | N | P | I | F | B | D | T | L | C | G | O | yes | no

Syntax Element Description:

Syntax Element | Description
--- | ---
`operand1` | Event Name: `operand1` is the name of the event to be sent.
`operand2` | Dialog Identifier: `operand2` is the identifier of the dialog receiving the user event. operand2 must be defined with format/length I4.
`operand3` | Parameters to be Passed: It is possible to pass parameters to the dialog. See WITH PARAMETERS Clause below.
`AD=` |
Attribute Assignment: If operand3 is a variable, you can mark it in one of the following ways:
`AD=O` | Non-modifiable, see session parameter `AD=O`.
`AD=M` | Modifiable, see session parameter `AD=M`. This is the default setting.
`AD=A` | Input only, see session parameter `AD=A`.
`operand3` cannot be explicitly specified if `operand3` is a constant. `AD=O` always applies to constants.
`nX` | Parameters to be Skipped: With the notation `nX` you can specify that the next `n` parameters are to be skipped (for example, `1X` to skip the next parameter, or `3X` to skip the next three parameters); this means that for the next `n` parameters no values are passed to the dialog. A parameter that is to be skipped must be defined with the keyword `OPTIONAL` in the dialog's `DEFINE DATA PARAMETER` statement. `OPTIONAL` means that a value can - but need not - be passed from the invoking object to such a parameter.
`USING DIALOG dialog-name` | Dialog Name: Name of the dialog receiving the user event.

### WITH PARAMETERS Clause

With this clause, parameters may be passed to the dialog selectively.

Note
You can only use this clause if the specified target dialog specified in `dialog-name` is cataloged.

`WITH PARAMETERS` {parameter-name=operand3}
`END-PARAMETERS`

Syntax Element Description:

Syntax Element | Description
--- | ---
`parameter-name=operand3` | Parameters: As `operand3` you specify the parameter(s) to be passed to the dialog. Note If the value of a parameter marked with `AD=O` and passed "by reference" is changed in a dialog, this will lead to a runtime error.
`END-PARAMETERS` | End of PARAMETERS Clause: The Natural reserved word `END-PARAMETERS` must be specified to end the `WITH PARAMETERS` clause.

## Further Information and Examples

See the section Event-Driven Programming Techniques in the Programming Guide.

### On this page

- SEND EVENT Usage
- SEND EVENT Syntax Description
- Further Information and Examples