Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN FOR...... problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00175495
Message ID:
00175542
Vues:
24
Perry,

Try this variation on your code;
SELECT myTable1
FOR I = 1 TO ALEN(myArray1)
   FOR J = 1 TO ALEN(myArray2)
      SCAN FOR myField1 = myArray1(I) AND myField2 = myArray2[J]
         SELECT myTable2
         locate for myField1 = myVar
         .
         .
         .

      ENDSCAN
   ENDFOR
ENDFOR
First SCAN has an implicit WHILE NOT EOF() so you don't need it. Second you can combine the two conditions into one SCAN FOR expression. Third the locate needs to be done in a different work area so select that area first. Fourth there's no need to reselect the work area being scanned as that is automatically done by ENDSCAN. Finally, SCAN always starts at the top of the table unless you use an explicit WHILE condition or use the REST keyword, so the GO TOP's are not required.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform