> sele filename
> X = afields(flds)
> dime flds2[X]
> for i = 1 to X
> mnewfld = 'm.'+flds[i,1] && Should create the m.FieldName(i)
> moldfld = 'xxx_'+flds[i,1] && the memory variables
> &mnewfld = &moldfld && Move the value into the "m." field
> endfor
>
> You might have to play with it just a tad, but I've used similar code
> often.
just about what I wanted to suggest, with a bit of difference:
sele filename
X = afields(flds)
for i = 1 to X
xxx="xxx_"+flds[i,1]
m_dot="m."+flds[i,1]
if type(xxx)#"U"
store (xxx) to (m_dot)
endif
endfor
This checks for unmapped fields and skips them, and, besides, reminds me
of the joy I had when first I discovered that name expressions can be
used to create variables :)