(go to: table of contents, index, list of VMS objects, prev: vmsobj_iosb, next: vmsobj_nam)
A programmer can create multiple, independend vmsobj_lksb objects and use
them in parallel.
For now the 'pyvms' module contains a function to
explicitly create a vmsobj_lksb object within Python. Note that interface
routines (e.g. vms_sys.enqw) can implicitly
create a vmsobj_lksb object!
The routine that allocates a new OpenVMS LKSB does automatically zero its
contents.
@@@
Examples:
Attributes:
Creation:
>>> import pyvms
>>> # create a zero-filled lksb
>>>
>>> lksb = pyvms.vmsobj_lksb ()
>>> type (lksb)
<type 'vmsobj_lksb'>
>>> lksb
<vmsobj_lksb, LKSB at 0x00218530>
>>>
>>> lksb.b0
0
>>> lksb.w1
0
>>> lksb.l1
0
>>> lksb.q
0L
>>>
>>> lksb.b0 = 1
>>> lksb.w1 = 0x34
>>> lksb.l1 = 0xabcdef
>>>
>>> hex (lksb.w3)
'0xab'
>>> hex (lksb.l0)
'0x340001'
>>> hex (lksb.l1)
'0xabcdef'
>>> hex (lksb.q )
'0xABCDEF00340001L'
>>>
>>> lksb.b
(1, 0, 52, 0, 239, 205, 171, 0)
>>> lksb.w
(1, 52, 52719, 171)
>>> lksb.l
(3407873, 11259375)
>>> lksb.q
48358647401807873L
>>>
>>> lksb.b0 = 'X'
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: vms__cvt_py2bin(): data of item must be integer
>>>
>>> lksb.no_attr = 0
Traceback (innermost last):
File "<stdin>", line 1, in ?
AttributeError: non-existing vmsobj_lksb attribute
>>>
>>> lksb.no_attr
Traceback (innermost last):
File "<stdin>", line 1, in ?
AttributeError: no_attr
>>>
...
@@