Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reverse SCAN...ENDSCAN
Message
De
11/09/2006 16:33:00
Mike Yearwood
Toronto, Ontario, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01152785
Message ID:
01152871
Vues:
25
>>>>I want to scan a table from bottom to top. Currently, I am using a while loop for that. Is there any faster way like scan?
>>>>
>>>>Thank you,
>>>>Ali
>>>
>>>No, not really. Do while and SCAN are equavalent in speed, AFAIK.
>>
>>I have not tested this for a few years but SCAN was 15% faster than using a DO WHILE loop.
>
>Interesting. I forgot that SCAN respects the order set on the table...
>
>Also why would we have a speed difference in WHILE LOOP vs. SCAN? It's doing the same, though we need to write more code. I guess internally it uses something different...

SELECT table1
DO WHILE NOT EOF()
DO SOMETHING && which changes workarea without putting it back.
select table1
IF NOT EOF()
SKIP
ENDIF
ENDDO

versus

SELECT table1
SCAN
DO SOMETHING && which changes workarea without putting it back.
ENDDO
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform