Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scanning a field and replacing
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019759
Message ID:
01019772
Views:
18
>Yes, basically this field can be used to add more comments. All I want to do is firstly scan to see if 'Img Submit' is there. If not then add it to the end of the comments. If it is there then at whatever piont it is there then replace the Img Submit to Img Re-submit.
>
>Thanks

What about:
DO CASE
   CASE [ Img Submit ] $ MyField
         REPLACE MyField WITH STRTRAN(MyField,[ Img Submit ], [ Img Re-Sumbit ])
   CASE [ Img Re-Submit ] $ MyField
         REPLACE MyField WITH STRTRAN(MyField,[ Img Re-Submit ], [ ????????? ])
OTHERWISE
         REPLACE MyField WITH MyField + [ Img Submit ]
ENDCASE
But this will replace ALL instances of "Img Submit" or "Img Re-Submit" with the new values.
If you have "Img Submit" more then once you'll get "Img Re-Submit" exactly same numbers of occurancies after replace.
I don't know if this will works for you.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform