Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Expansion with REPLACE
Message
From
23/04/2002 17:27:20
 
 
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:
00648435
Views:
15
>Hi all
>
>Has anyone had any success using macro (&) expansion with the REPLACE command?
>
>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.
>
>The code is like this:
>
>lcfieldname = "field" + INT(VAL(lnCnt)) && ex. to illustrate changing field name
>
>lcvalue = "myvalue"
>SELECT mytable
>REPLACE &lcfieldname WITH lcvalue
REPLACE (lcFieldName) WITH lcValue
>lnCnt = lnCnt + 1
>
>Any suggestions would be appreciated.
>
>Thanks
>Donald Lowrey
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform