Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Will the 'Fox is Dead' prophecies become self-fulfilling
Message
From
14/12/1999 08:04:46
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00301589
Message ID:
00303288
Views:
27
OK. I thought maybe there was something else.

Though I cannot recall a good example I have often used this code -- except I formatted it to be more readable and minus "LOOP". When doing mass data updates where many fields are the result of fairly involved concatenation, trimming, calculation, etc., I think it is reasonable to use this code for readability, maintainability and to precisely manage the value being replaced. I am also reluctant to make hugely long REPLACE statements.

>Of course it works, but just count the number of lines of code executed for the table of, say, 100,000 records, insead of just one line with
>REPLACE ALL field1 WITH value1, field2 WITH value2...
>
>
>>What is your objection to the code that you listed?
>>
>>>DO WHILE !EOF()
>>>REPLACE field1 WITH value1
>>>REPLACE field2 WITH value2
>>>REPLACE field3 WITH value3
>>>REPLACE field4 WITH value4
>>>REPLACE field5 WITH value5
>>>
>>>*....replace more fields
>>>
>>>SKIP
>>>
>>>LOOP
>>>
>>>ENDDO
Previous
Reply
Map
View

Click here to load this message in the networking platform