Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress - incremental lookup and typing speed
Message
From
22/04/2002 02:15:31
Walter Meester
HoogkarspelNetherlands
 
 
To
21/04/2002 20:43:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00647269
Message ID:
00647446
Views:
14
Andrew,

>Thanks Dragan, I have already been using and extending this code. It works well until my source file starts to grow... I expect to see as many as 150,000 items in the list of possible values, so evaluating the list on each keypress gets cumbersome rather quickly.
>
>That's why I am doing an indexed SEEK on the source file. I would really like to know what goes on with the speed of typing. Why do keypresses override the code contained within the KEYPRESS method.

Like Jim has been expressing, 150,000 items is way too much for an list or combobox. You'll likely see an gigantic delay when starting this form as the combobox has to load all 150,000 items.

However, you can get a good performance, if the items are sorted in alfabetical order. In the keypress you can start in the middle of the listitems and compare if it greater, smaller or equal than the value sought, then take the middle of greater or smaller part and take the middle again (like a B-tree search) until you've found the matching value. One item out of 150,000 should be found in at most 17 comparisons.

Walter,


>
>>>>Andrew,
>>>>
>>>>Stop writing code! combos do incremental lookup by default if you make them Type 2- Drop down list. The typing speed is controled by _dblclick in VFP 6 and earlier and _incseek in VFP 7.
>>>
>>>The reason I am doing the code bit is to get a QuickBooks style prompt, in the Combo Box, of a found existing value. My client uses QuickBooks, and I am trying to mimic its interface as much as possible...
>>>
>>>I will play around with alternatives, but I still would like to get it to work...
>>>
>>>Thanks for the response.
>>
>>Check downloads here, file #9534 and #72.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform