Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Chris..
Oops... thanks for catching this...:)
Yes, you do need to set the order.. You did'nt miss a thing!!
Thanks again for clarifying this...
>>Hi Chris...
>>
>>As everyone has pointed out, these commands are rushmore optimizable. However, that isn't the real key to the speed. First off, the FOR operator will evaluate ALL records. Instead, it is much faster to use a combination of Seek and Locate.
>>
>>For example, lets say you wanted to loop through the records where state = "PA". Something like this would be much faster:
>>
>>Select customers
>>If Seek("PA","customers","state")
>> Scan While State = "PA"
>> */ Do your stuff
>> EndScan
>>Endif
>
>Don't you need to explicitly set the order to optimize this? In other words, the SEEK("PA", "customers", "state") doesn't set the order of the records before the SCAN is done, or am I missing something?
>
>Select customers
>Set order to state
>If Seek( "PA" )
> Scan While State = "PA"
> */ Do your stuff
> EndScan
>Endif
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement