Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN FOR ... WHILE
Message
De
14/05/1999 13:28:36
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SCAN FOR ... WHILE
Divers
Thread ID:
00219112
Message ID:
00219112
Vues:
61
I've been using this technique for a while. I thought that the SCAN FOR would start at the top of the file and act as a filter only looking at records that meet the condition and the WHILE would cause the loop to end as soon as its condition was false.

This is just a bogus example to illustrate the point.
lnInvoiceHdrId = Invoice.iInvoiceHdrId

llTableUpdateOk = .T.

SELECT InvoiceDtl
SCAN FOR InvoiceDtl.iInvoiceHdrId = lnInvoiceHdrId WHILE ;
         llTableUpdateOk
     llTableUpdateOk = TABLEUPDATE( .F., .F., "InvoiceDtl" )

ENDSCAN
I thought that this would start at the top of the file and find all Invoice details that matched that Id and continue until it hits the end of the file or when the tableupdate fails.

Similaray SCAN has an implicit WHILE NOT EOF() by itself.

So does the SCAN WHILE without a FOR start at the top of the file or does it start from the current record positioning and move forward?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform