(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vmsobj, next: vmsobj_fab)

This section explains the use of 'VMS objects'.

'VMS objects' serve as an access means to complex data structures like FABs or RABs. The goal is to make as much functionality available as possible, but keeping the Python interpreter stable. For example, it is not possible to directly store an address in a data structure.


The components of a structure are accessible through the get- and set-attribute interfaces of the object. Please note that the attribute names are not visible, Python's "dir()" function will just display an empty list unless the object contains any methods:

>>> fab = pyvms.vmsobj_fab()
>>> dir (fab)
[]
>>>
>>> membuf = pyvms.vmsobj__membuf(5)
>>> dir (membuf)
['zero']
>>>

Integer data types (Byte, Word, Long) can be accessed directly:

>>> # set FAB$L_ALQ
>>> fab.L_ALQ = 100
>>> print fab.L_ALQ
100
>>>

>>> # set FAB$B_BKS
>>> fab.B_BKS = 12
>>> print fab.B_BKS
12
>>>

Single bits can be directly set/cleared and queried by specifying the name as the attribute:

>>> # set FAB$M_GET
>>> fab.M_GET = 1
>>> print fab.M_GET
1
>>> print fab.B_FAC  # FAB$M_GET is in FAB$B_FAC
2
>>>

Other, more complex datatypes will be described together with the object.


(go to: table of contents, (go to: table of contents, index, list of vmsobj, next: vmsobj_fab)

03-MAR-1999 ZE.