Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Will the 'Fox is Dead' prophecies become self-fulfilling
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00301589
Message ID:
00303288
Vues:
33
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
Fil
Voir

Click here to load this message in the networking platform