[ ECLiPSe Event built-in.|Group Index| Full Index]

event(+EventName)

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

+EventName
Atom or Integer.

Description

The event EventName 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 is associated to EventName, or EventName is neither atom 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

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