Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which command would execute faster? Seek & Do while or S
Message
From
28/03/2006 21:04:30
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
28/03/2006 20:53:46
Sonny Tabano
Trams Printwork, Inc.
Mabalacat, Philippines
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01108228
Message ID:
01108654
Views:
15
>Hi Rich,
>
>Thanks for the advice. Cust_ID is a character ("0008") not 8. What I wanted to do is to go directly to the records for Cust_ID="0008" and sum all the orderamount (as indexed on Cust_ID) and immediately stop summing the orderamount when it encounter the next record not equal to "0008" (Cust_ID). I wanted to completely avoid all those Cust_ID<>"0008".
>
>Since Sum .... for ... Cust_ID="0008" would still go though all of the records and would take some time somehow so does with using SQL thats why I thought of the seek and do while. I've used the "&" because the input would be coming from the user of his/her choice of Cust_ID. (Dont know if this is a good idea or not).
>

It's not! If you have a character variable lcVar and it contains "00008" when you ?&lcVar. you will get the numeric value 8. Not only that, it's much slower to use &.

Doing it with cust_id = m.lcVar will work much faster so long as the cust_id in the table matches the data type of the m.lcVar.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform