(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_sys, prev: SETDFPROT, next: SETPRI)


SETEF - Set Event Flag


The Set Event Flag service sets an event flag in a local or common event flag cluster.

Format:

    setflg = vms_sys.setef (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.
Arguments:
efn
Number of the event flag to be set. SYS$SETEF uses only the low-order byte.
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 was 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: SETDFPROT, next: SETPRI)

28-SEP-1998 ZE.