Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPD25 - REPLACE ... WHILE ... is ALL reqd.
Message
 
À
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:
00762030
Vues:
52
Just from the top of my head, it can help in places of compound index expr.s for such purposes. Give it a shott as soon as requirment crops up, I don't have the guts to touch old codes.

>>>>>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
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform