Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN LOOP Goofing up
Message
De
14/10/2009 16:58:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01429392
Message ID:
01429432
Vues:
50
>I have one SCAN Loop going. I am adding data from the main WORK.DBF file to a file called BATCHN.DBF. At the end of the loop (ENDSCAN), the WORK.DBF file is reselected, and it shows that we are on the 2nd recor, which is great. However, once I select the BACTHN.DBF table, the record in WORK jumps back to the previous record we were on in the WORK table.
>
>I have not placed any GO TOP command in this code. I cannot figure out why the record in WORK on its second pass doesn't stay on the 2nd record, but goes back to the top or the previous record (same thing).
>
>The SCAN LOOP has no conditions.

After what the others have suggested, I would suggest the following steps:

1. comment out everything between the first SCAN to ENDSCAN
2. now verify (via debug) that the table is stepped through to each record
3. now uncomment one line of code at a time starting from the beginning of the loop.
4. verify again that the table is looped through
5. when you uncomment an IF uncomment the associated ENDIF
6. repeat until all uncommented or the record pointer jumps unexpectedly

This should give you where the problem occurs inside of your loop. You have to be moving the record pointer somehow external to the SCAN loop.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform