Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPD25: SCAN WHILE fails SCAN FOR doesn't
Message
 
À
07/02/2002 19:31:59
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00614777
Message ID:
00618163
Vues:
30
Thanks for a great Idea but here is my final implementation:
select * from mydbf where mydbf.myfield=myid into cursor mc
sele mc
scan
  select mydbf
  seek mc.keyfield

  if found()
    select myotherdbf and do stuff

    select mydbf
    delete
  endif

  sele mc
endscan
This way I can use my old code without major changes.

>Try this
>select * from mydbf where mydbf.myfield=myid into cursor mc
>sele mc
>scan
> select myotherdbf and do stuff
> select mydbf
> seek mc.keyfield
> if found()
> delete
> endif
> sele mc
>endscan
>if you are working with large numbers of records this should be faster. What I believe is happening with your code is that once you delete the current record the while condition is no longer met and the program drops out of the loop.
>SCAN WHILE myDBF.myField = myID
>>>>> SELECT myOtherDBF
>>>>> *** myOtherDBF manipulation logic goes here
>>>>>
>>>>> SELECT myDBF
>>>>> DELETE
>>>>> ENDSCAN
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform