Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field values from a variable
Message
 
To
16/09/1998 08:31:06
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00136777
Message ID:
00137247
Views:
30
>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

Cetin,

Thanks for the help. I tried all of the above, still no luck. I think I may have to create 15 new variables to accomplish the task and use them in my method.

Still, it makes me wonder where the error could lie.

Much Thanks
Perry E. Chrzanowski
Programmer/Analyst
Saturn (Solutions) Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform