Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPD25 - REPLACE ... WHILE ... is ALL reqd.
Message
De
06/03/2003 02:10:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00761380
Message ID:
00762011
Vues:
34
This message has been marked as the solution to the initial question of the thread.
>Thanks for your response, I can't understand why the failure so I have started putting in set order before seek just in case.
>

Just in case ???
Oh from your first message I assumed you were using it already. With WHILE it should be the case. A WHILE ends as soon as the criteria is false. So a set order is quite a need for sampe code like yours. You can't depend on physical entry order.
In any case if you think WHILE is a problem simply use FOR instead. A FOR automatically rewinds to top, yes, but fox is clever enough to use index to find records for replacement with expressions like in your sample (I don't mean WHILE is a problem - whenever I saw WHILE fail it was my fault not Fox's).

WHILE with ALL is likely to always fail. Suppose you have ids :

1...1000

lnID = 32
seek lnID
replace myField with 'dummy' WHILE IDField=m.lnID ALL && 0 replacement

If I remember correct in your original message m.id was char ? If so remember if set exact is off :

ID:A would match m.ID 'A','AA','AB','A...' etc Padr the id to fieldsize and use == (or exact on).

PS: You can use FOR and WHILE together in the same command.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform