[ Event Handling | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

event(+EventId)

The event EventId is raised and the corresponding error handler is executed.
+EventId
Atom, Handle or Integer.

Description

The event EventId is raised and the corresponding error handler is executed.

Other ways to raise events are by

   - one of the builtins error/2 or error/3.
   - posting an event from external code using ec_post_event().
   - an interrupt whose handler has been specified as event/1.
The latter two have the effect of dynamically inserting an event/1 goal into the current execution at the next synchronous point, which is usually just before the next predicate call.

Fail Conditions

Fails if the handler fails.

Resatisfiable

No.

Exceptions

(32) no handler for event
No handler is associated to EventId, or EventId is neither an atom, a handle, nor integer.

Examples

    [eclipse 1]: event(hello).
    warning: no handler for event in hello
    yes.
    [eclipse 2]: set_event_handler(hello, writeln/1).    
    yes.
    [eclipse 3]: event(hello).
    hello
    yes.




See Also

is_event / 1, error / 2, error / 3, reset_event_handler / 1, set_event_handler / 2, set_interrupt_handler / 2