GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-87
WAIT^EVENT
mask parameter, along with the corresponding event value returned if the event is
detected:
You can define bits 1 through 7 to create other events to be detected. If bit 0 is
turned on, all other bits in the word are considered to be turned on too. If new
events are created in this way, the WAKE^TASK procedure can be used to cause the
events on another task. See the description of the event parameter in Table 8-2 for
information on what values are returned for created events.
To determine the mask value, choose the events you wish to test for (see Table 8-2)
and then add together the corresponding literals from the preceding DISP-list to set
the mask parameter, as shown in the following example:
CALL ^READUPDATE(IN^QUEUE^FILE^NUM);
IF (EVENT := WAIT^EVENT(DISP^ITC + DISP^STOP +..)) = E^ITC
OR EVENT = E^STOP THEN
BEGIN
IF EVENT = E^ITC THEN
BEGIN
@IOCB := ^LISTEN(0,0,1);
.
process the request
.
CALL NOTIFY^IO^COMPLETION(IOCB . .);
END
ELSE
IF EVENT = E^STOP THEN
.
When more than one event is detected by WAIT^EVENT, the calling task is notified
of the masked event with the highest bit number from the DISP-list.
timeout input
INT(32):value
Mask Event Literal Binary Value Bit Number
Corresponding event
Value Returned
DISP^STOP %B1 15 1
DISP^CONTINUE %B10 14 2
DISP^CANCEL %B100 13 3
DISP^IMSG %B1000 12 4
DISP^ITC %B10000 11 5
DISP^IOC %B100000 10 6
DISP^RESOURCE %B1000000 9 7
DISP^CHANGE %B10000000 8 8