Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Expansion with REPLACE
Message
From
23/04/2002 17:18:14
 
 
To
23/04/2002 17:12:22
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00648428
Message ID:
00648429
Views:
18
Donald,

Two changes, marked below. You can do this with a named expression (using parenthesis) rather than macro expansion.

HTH,

steve

>
>I am attempting to use a loop with a REPLACE inside the loop. The field names and the values to be replaced change with every iteration. I am using macro substitution, the values are correct asigned, but REPLACE crashes every time with an unrecognized command or syntax error, depending on the circumstances.
>
>lcfieldname = "field" + alltrim(str(lnCnt))  && change here
>
>lcvalue = "myvalue"
>SELECT mytable
>REPLACE (lcfieldname) WITH lcvalue    && change here
>lnCnt = lnCnt + 1
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform