Snip..
>
>
>I'm taking data from xtab and inserting it into the other table the whole trouble lies in this section:
>
>
>lnATAFValue = EVAL('xtab.'+lcFName)
>lcATAFValue = STR(lnATAFValue)
>SELECT ATA_Report
>GO BOTTOM
>REPLACE &lcATAFName WITH TRIM(lcATAFValue)
&& WILL NOT DO REPLACE>
>The program won;t execute the REPLACE command. I have another FOR loop that does the same with numeric fields and it works (identical syntax). I find it a little strange and frustrating to be honest.
Perry,
I might have spotted the failure point. Not sure w/o knowing the structure of ATA_report (does it have char fields not large enough to hold num2char converted ?). While converting num to char you don't ltrim() thus ie: 1 converts to " 1" which might be longer than yout ATA_report field length. So if this could be the error point either :
lcATAFValue = STR(lnATAFValue)
* Change to
lcATAFValue = ltrim(STR(lnATAFValue))
* Or
REPLACE &lcATAFName WITH TRIM(lcATAFValue)
*change to
REPLACE (lcATAFName) WITH allTRIM(lcATAFValue) && () is better than & for name expressions.
Cetin