Structured System variables -- ^$EVENT

^$E[VENT]

Introduced in the 1995 ANSI M[UMPS] Windowing Application Programmer's Interface standard.

This structured system variable provides information about the events that may occur in the current M[UMPS] system.

WRITE !,"An event was just recognized."
SET T=^$EVENT("TYPE"),C=^$EVENT("CLASS")
SET S=^$EVENT("SEQUENCE")
WRITE !,"Event number ",S,", event type was ",T
WRITE " and event-class was ",C,"."
SET W=$GET(^$EVENT("WINDOW"))
IF W'="" WRITE !,"Event occurred in window ",W,"."
SET E=$GET(^$EVENT("ELEMENT"))
IF E'="" WRITE !,"Event was associated with ",E,"."
SET K=^$EVENT("KEY")
IF K'="" WRITE !,"Depressed keys: ",K,"."
SET P=^$EVENT("PPOS")
WRITE !,"Cursor located at (",P,")."
SET K=^$EVENT("PSTATE")
IF K'="" WRITE !,"Depressed mouse buttons: K,"."
IF T="SELECT" DO
. WRITE !,"The choice was ",^$EVENT("CHOICE"),"."
. QUIT
IF (T="CHANGE")!(T="UNFOCUS") DO
. SET N=^$EVENT("NEXTFOCUS")
. WRITE !,"Focus transferred to ",N,"."
. QUIT
IF T="FOCUS" DO
. SET P=^$EVENT("PRIORFOCUS")
. WRITE !,"Focus transferred from ",P,"."
. QUIT
IF $DATA(^$EVENT("OK")) QUIT
; Perform event-specific clean-up activities
QUIT

Approved for addition in a future ANSI M[UMPS] Language standard.

The ability to process events in an asynchronous fashion is introduced. The commands ABLOCK, ASTART, ASTOP and AUNBLOCK allow for starting and stopping recognition of certain events. The structured system variable ^$JOB is used to register the entry point this is intended to be started when a certain event occurs. Nodes in ^$EVENT are used to specify other specific behavior of the various events.

^$EVENT("EVENTDEF","TIMER",timerid,"INTERVAL") identifies the duration of the waiting period for a specific timer.

^$EVENT("EVENTDEF","TIMER",timerid,"ACTIVE") indicates whether a specific timer is currently active (boolean value).

^$EVENT("EVENTDEF","TIMER",timerid,"AUTO") is the value that would be re-set automatically into ^$EVENT("EVENTDEF","TIMER",timerid,"INTERVAL") when its value decrements to a value that is not positive (note that 0 is not a positive number in M[UMPS]).


This document is © Ed de Moel, 1995-2005.
It is part of a book by Ed de Moel that is published under the title "M[UMPS] by Example" (ISBN 0-918118-42-5).
Printed copies of the book are no longer available.

This document describes the various special (system) variables that are defined in the M[UMPS] language standard (ANSI X11.1, ISO 11756).

The information in this document is NOT authoritative and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an authoritative definition.

In this document, information is included that will appear in future standards.
The MDC cannot guarantee that these 'next' standards will indeed appear.