[Info-vax] VMS Python: Calling sys$trnlnm()
Andrew Shaw
andrew at feeandl.com
Fri Mar 27 05:29:23 EDT 2020
On Friday, March 27, 2020 at 8:26:20 PM UTC+11, erga... at gmail.com wrote:
> Possibly trnlnm could be fixed to coerce the return value to an int. I'll leave that to smarter people than me. However, the struct module is what you need to solve the immediate problem.
>
> from struct import unpack
>
> from vms.itemList import *
> from vms.lnmdef import *
> from vms.starlet import trnlnm
>
>
> attr=0
> s, d = trnlnm (attr,
> "LNM$FILE_DEV",
> "MYLOGICAL",
> None,
> (
> itemList(LNM__STRING),
> itemList(LNM__ATTRIBUTES)
> )
> )
>
> attrib = d[LNM__ATTRIBUTES]
> attrib = unpack('<I', attrib)[0]
> print(attrib & LNM_M_TERMINAL)
HaHa - Nice - thanks you very much.
struct does indeed look like my missing link.
I had seen vague reference to it, but wasn't sure.
I will def play with this now - appreciate the pointer (pun intended) !!!
More information about the Info-vax
mailing list