OnEvent()

Syntax

OnEvent (Address of Function)

Description

Returns a new Number and connects a Function to it.

Keep in mind:
If you feed this command in the wrong way your application could CRASH before I'm able to return -1, because there is no way for me to check if the provided Address of a Function (Subroutine) is valid.

Parameters:
The Address of a Function.

Return value:
The Number for a MenueItem, a ToolbarButton or a Gadget.
This command returns -1 if it fails.
EventConnection - Index