Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPD25 - REPLACE ... WHILE ... is ALL reqd.
Message
 
À
06/03/2003 01:57:40
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00761380
Message ID:
00762026
Vues:
42
Thanks for responding Bob. I feel I have messed up the index somewhere changed it to something else, where I wouldn't know as it happens randomly, the failing. I have put in specific code to switch order now, just to be safe.

FOR I had used it originally but it became slow over the LAN maybe my problem. WHILE was working well till recently but now it fails randomly for this client specifically, no other client has complained similaryl yet.

>This is how I understand the REPLACE COMMAND works:
>
>First the REPLACE command starts replacing from the current position of the record pointer unless you use the ALL keyword. If this is done the REPLACE command starts at the top of the file and will replace the field with the specified vaule for all records.
>
>Regardless where the record pointer is at, when you use the WHILE key word (with out ALL keyword) it will start replacing from the current record position until the criteria ISN'T met. This could be for next 1 record, 0 records or for several records. As soon as the criteria isn't met the replacing stops. Now, you could have several other records in a file that meet the criteria specified in the WHILE expression but the replace stopped because the expression wasn't met before these other records.
>
>You'd have several options but I can think of 2 quick ones. One - order the table by the field being used in the criteria, Locate or Seek to the first record then use REPLACE WHILE. TWO - Use REPLACE FOR (w/o ALL keyword, it's unnecessary here) instead. This will start from the top of the file and replace all records that met the critera. I also think REPLACE FOR is optimizable so to me, this would be the way to do it.
>
>Like I said this is the way I understand it to work. Hope this helps.
>
>BW
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