Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to search a value in a List Box not using by Loop ?
Message
 
 
À
18/11/2009 23:18:21
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01435500
Message ID:
01435506
Vues:
44
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform