Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gotcha :)
Message
De
30/03/2005 15:48:47
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01000085
Message ID:
01000088
Vues:
25
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>Spent ~ 10 minutes (or more) trying to figure out this simple thing.
>
>I have this in my code:
>
>select c_Profiles
>scan while empty(m.lcError)
>...
>
>
>Couple of lines of code above I did a SUM on this file (I guess, I better do a select sum(..) then). And therefore I was at the bottom of the file. I used to the fact that SCAN goes top automatically and haven't realised that WHILE scope changes it.
>
>Well, at least I figured this one out :)
>
>Thanks.



SCAN and SCAN FOR start at the top. SCAN WHILE starts at the current location. All leave the file pointer at the last record seen if you exit the loop or at EOF() if the SCAN..ENDSCAN was run for the whole file.

If you do something inside the loop that moves the pointer -like SUM() in your example-, then SCAN gets screwed up.

HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform