(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_sys, prev: PURGWS, next: REM_HOLDER)


READEF - Read Event Flags


Returns the current status of all 32 event flags in a local or common event flag cluster and indicates whether the specified event flag is set or clear.

Format:

    setflg, state = vms_sys.readef (efn)
Returns:
setflg
The system service returns SS$_WASSET or SS$_WASCLR to indicate if the specified event flag was previously set (1) or cleared (0). Any other code returned from the system service results in a Python exception.
state
State of all event flags in the specified cluster.
Arguments:
efn
Number of any event flag in the cluster whose status is to be returned. Number of the event flag to be set. SYS$READEF uses only the low-order byte. Specifying an event flag within a cluster requests that READEF return the status of all event flags in that cluster.
Examples:
>>> import vms_sys

>>> setflg, state = vms_sys.readef (17)
>>> setflg, state
(0, -536870909)
>>> print state & (2**17)
0
>>> # EFN 17 is clear


>>> setflg, state = vms_sys.readef (1)
>>> setflg, state
(1, -536870909)
>>> print state & (2**1)
2
>>> # EFN 1 is set (first EFN is EFN 0!)


>>> vms_sys.clref (1)
1
>>> # EFN was set
>>> vms_sys.clref (1)
0
>>> # EFN was clear


>>> vms_sys.setef (17)
0
>>> # EFN was clear
>>> vms_sys.setef (17)
1
>>> # EFN was set


>>> setflg, state = vms_sys.readef (1)
>>> setflg, state
(0, -536739839)
>>> print state & (2**1)
0
>>> # EFN 1 is now clear (first EFN is EFN 0!)
>>> print state & (2**17)
131072
>>> # EFN 17 is now set


>>> setflg = vms_sys.clref (255)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (236, '%SYSTEM-F-ILLEFC, illegal event flag cluster')

>>> setflg, state = vms_sys.readef (255)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (236, '%SYSTEM-F-ILLEFC, illegal event flag cluster')

>>> setflg = vms_sys.setef (255)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (236, '%SYSTEM-F-ILLEFC, illegal event flag cluster')
>>>

>>> setflg = vms_sys.clref ('X')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation
>>>

>>> # 72 is in a common EFC that is not associated
>>> setflg = vms_sys.clref (72)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (564, '%SYSTEM-F-UNASEFC, unassociated event flag cluster')
>>>

(go to: table of contents, index, list of vms_sys, prev: PURGWS, next: REM_HOLDER)

28-SEP-1998 ZE.