Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box Problem
Message
 
To
20/10/1999 17:38:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00279102
Message ID:
00279183
Views:
12
>
>i've got it that far, but i'm wanting to use the value in the second column in some math functions, and the value in the third column in other math functions.
>my widths are 50,0,0. basically, i need to know how to reference the column i want.

Hi Jimmy,

I'm going to make a guess. Your RowSouceType is 1-Value, and you entered the values by hand (or with the builder) into RowSource, right?

You can get the values but it's kind of confusing at first.
WITH THISFORM.Combo1
	.LIST[ .ItemIdToIndex(.ListItemID), 2 ]
ENDWITH
A combo has a list property. It's an mulit-dimensional array of strings containing all the values in the combo. VFP automagically assigns a unique ID to each row in the list property.

You get the Currently selected item from the .ListItemId property. But, it's the ID VFP assigns to it. You then convert that to the actual index number with the .ItemIdToIndex method. That will return a number we can work with. We then just look it up in the .list array.

The 2 in the above code just says to use the 2nd column.

NOTE: You may need to tweak the above because it will return 0 if nothing has been selected in the combo yet.

Also, Working with combos this way is kind of a pain. See Mark's other posts about how to use them with a little more ease.

HTH
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Reply
Map
View

Click here to load this message in the networking platform