General information
Category:
Coding, syntax & commands
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only