Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPD25 - REPLACE ... WHILE ... is ALL reqd.
Message
De
06/03/2003 04:25:54
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00761380
Message ID:
00762029
Vues:
54
>>>>Just in case ???
>>>>Oh from your first message I assumed you were using it already.
>>>
>>>When I open the file the order is set alright, maybe I have messed it somewhere along the code.
>>>
>>>>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).
>>>
>>>Same I guess in my case, but the fun part is that it randomly fails.
>>>
>>>>
>>>>WHILE with ALL is likely to always fail. Suppose you have ids :
>>>
>>>True
>>>
>>>>If I remember correct in your original message m.id was char ? If so remember if set exact is off :
>>>
>>>That is an idea maybe the replacement is being done but somewhere else and I guess exact is off
>>>
>>>>PS: You can use FOR and WHILE together in the same command.
>>>
>>>REPLACE dbf.fld WITH .T. FOR dbf.id = m.id (WHILE ???)
>>
>>seek m.ID
>>replace f1 with value1, f2 with value2 ;
>>while dbf.id = m.id for SomeField = SomeValue
>>
>>This makes the replacement WHILE the ID is m.ID but only FOR records where SeomeField is also equals to SomeValue. ie:
>>
>>
>>id  f1 f2 somefield
>>--  -- -- ---------
>>1
>>2
>>3   1  2  ready
>>3   4  3  notready
>>3   1  6  ready
>>3   7  3  notready
>>4
>>
>>seek 3
>>replace f1 with f1+1, f2 with f2-1 while id = 3 ;
>>   for somefield = 'notready'
>>
Cetin
>
>Wow sort of a sub-filter with the speed of while, works with FPD?

Yes, as far as I remember works since FoxPro 1.0 (foxbase not sure) :)
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