Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to search a value in a List Box not using by Loop ?
Message
 
 
To
18/11/2009 23:18:21
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01435500
Message ID:
01435506
Views:
45
>Yes use programmatically, and no RowSource for the listbox.
>
>I only use AddItem to add values to the List Box and I want to search our the value in the List Box.
>But don't want using the Looping scan the whole List Box.
>
>Derek

If you need to find an index of the value, then the only way is a loop, though you may try to use some searching algorithms here.

I would simply loop
for lnI = 1 to this.Count
     ...
next
I don't think you would have too many items with AddItem, so looping will not degrade performance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform