Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Expansion with REPLACE
Message
From
23/04/2002 21:23:49
 
 
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:
00648500
Views:
13
If you are trying to replace EVERY field in the table:
for m.lnCnt = 1 to fcount("myable")
   m.lcfieldname = "mytable."+field(m.lnCnt,"mytable") && ex. to illustrate changing field name
   m.lcvalue = "myvalue"
   SELECT mytable
   REPLACE (m.lcfieldname) WITH m.lcvalue
next
If you have fields like field1,field2,field3...
 m.lcfieldname = "mytable.field"+alltrim(str(m.lnCnt)) && ex. to illustrate changing field name
   m.lcvalue = "myvalue"
   SELECT mytable
   REPLACE (m.lcfieldname) WITH m.lcvalue
   m.lnCnt = m.lnCnt + 1
HTH
Elmer
Previous
Reply
Map
View

Click here to load this message in the networking platform