>>
>>local Diag[ max you can think of ]
>>
>>Diag[VAL(.Field001)] = LEFT(ALLTRIM(UPPER(.Field003)),AT('^',.Field003)-1)
>>
>
>How can I take that array value and put into a memory variable that is named accordingly? There is a GATHER being done later in the code, so it needs to be m.Diag1, m.Diag2... Would I still use an array in that case, or can I just build the variable name and do it that way?
It can be an empty object...
oRec=createobject("empty")
...
addproperty(oRec, "diag"+alltrim(.field001), upper(getwordnum(.field003, 1, '^')))
You can then do gather name, or insert from name oRec.
[update:] forgot the object as the first parameter above. Added now.