Hi Frank,
Here is the Attributes function in o2pars.bas (handling structureof)
'---------------------------------------------------------
function attributes(s as string, byref i as sys) as string
'=========================================================
'
dim as sys kn,a,c,k,m,wa,ty
dim as string wr,w1
'
kn=maco(mp,5)
'
if ascn=lbr then c=1 : i+=1 'SKIP LEFT BRACKET
'
nmac=1
w1=pword(s,i) 'resolve
nmac=0
ty=typ
'if ascn=91 then fixsqbr(s,i)
'if ascn=lbr then wpfx+=arrayres(s,i,ty,w1)
typ=ty
'
if c then
if ascn=rbr then
i+=1 : skiplspace(s,i) 'BLANK RIGHT BRACKET
end if
end if
'
'
'
wr="0" : k=mp : m=k
'
'VARIABLE OR STRUCTURE ?
'
if mc>=0 then
m=mc
end if
'
'
'
select case kn 'SIZEOF
case 1
if mc=0 then
if isq(ascw) then
wa=cpuw
goto attrin
end if
end if
if mc>=0 then
wa=lent
elseif instrword(" string wstring bstring bstring2 ",w1) then
wa=cpuw
elseif instrword(" char zstring asciiz ",w1) then
wa=1
elseif instrword(" wchar zstring2 ",w1) then
wa=2
elseif mc<0 then
a=identype(w1) : if a then wa=lent
end if
goto attrin
case 2
if mc>=0 then
wa=maco(mp,2)+woff
end if
goto attrin 'OFFSETOF
case 3
if mc>=0 then
wa=wval(macso(mp,2)) 'SPANOF: NUMBER OF ELEMENTS OF MAIN ARRAY
if wa=0 then wa=1
end if
goto attrin
case 4 'TYPEOF:
if mc>=0 then
if len(sog) then
wr=sog
else
wr=identypes(typ)
end if
elseif mc<0 then
wr="metatype "+str(mc)+" "+_
dicsn(metatypes,mc) 'TYPEOF TYPE
end if
case 5
wr=macso(m,1) 'STRUCTUREOF ENCODINGOF
case 6
wr=macso(k,3) 'PROTOTYPEOF
case 7
wa=typ
goto attrin 'TYPECODEOF
case 8
wr=writestates(k,k) 'RECORDOF
case 9
if isstr(typ)=0 then
ert=109 : ers="Not a string"
else
makestrptr(w1)
function=w1 'STRPTR
end if
exit function
end select
'
'
'-----
attris:
'-----
'
if nl then
typ=0 'raw code
else
wr=iq+wr+iq 'quoted string literal
typ=&hc1
end if
'
goto attrix
'
'-----
attrin:
'-----
'
wr=str(wa) : typ=cpuw
'
'-----
attrix:
'-----
'
mc=0 : mp=0 : varf=0
function=wr
'
end function
Charles