Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box Question
Message
From
05/12/2008 13:10:10
 
 
To
04/12/2008 09:52:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01365396
Message ID:
01365721
Views:
12
Don't know if this is better or not, but another approach.......
FUNCTION searchcombo
LPARAMETERS toCombo,tcValue
LOCAL lcCurValue,llReturn
WITH toCombo
     lcCurValue = .DisplayValue
     .DisplayValue  = tcValue
     llReturn = .ListIndex > 0
     .DisplayValue = lcCurValue
ENDWITH
RETURN llReturn
>Rich
>
>That's what I ended up going with, but things like this have always been an issue with me and combo boxes. With all the properties that mean ALMOST the same thing - why isn't there an easy way to do the equivalent of a SEEK in a table or an ASCAN with an array?
>
>
>
>>
>>Is this what you're looking for???
>>FUNCTION searchcombo
>>LPARAMETERS tcValue
>>
>>WITH myCombo
>>     FOR I = 1 TO .listcount
>>	IF .List[i] = tcValue
>>	    RETURN I
>>	ENDIF
>>    ENDFOR
>>ENDWITH
>>RETURN 0  && Not Found
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform