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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement