It was not clear from the post. In the last case he should use evaluate, as Sergey showed.
>lcDir holds reference to a field ("tablename"+alltrim(str(i))+".cfield"). He wants the value in cfield not 'tablenameN.cfield'
>Cetin
>
>>I don't see, why it didn't. What is lcDir again?
>>
>>I just ran this test at command window:
>>
>>lcDir = '5'
>>lcTemp = "temp"
>>
>>store m.lcDir to (m.lcTemp)
>>?temp
>>?type('temp')
>>
>>Worked fine for me.
>>
>>>Sorry, but your sugestion did not work. However, if you do like this
>>>store &lcDir to (m.lcString) or store EVALUATE(lcDir) to (m.lcString), it works. Now, there is no macrosubstitution any longer but how to write the code with only name expressions, i.e. without EVALUATE().
If it's not broken, fix it until it is.
My Blog