Jump to content

Combo list identify list items


Recommended Posts

I'm working on a script that needs to work with a huge database inside a combobox.
I'm looking for the best way to link a multidimensional array to that data to load that data on to textfields.

example:

combo item 0 = "A", data = [index linked to combo item 0] [1,0,5,4,87,9,"xyz"]
combo item 1 = "B", data = [index linked to combo item 1] [1,6,5,4,87,9,"zzz"]
combo item 3 = "A", data = [index linked to combo item 3] [1,6,4,4,87,9,"aaa"] ; yes also double items!

Would also like to be able to delete and add items on the fly btw..

Local $INDEX[0][10] ; ubound wil be resized like a stack while loading from a textfile

;inside gui:
local $Combo = GUICtrlCreateCombo('...', 10, 10, 290, 25)

;gui loop:

While True
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Combo
            display() ; how do i link my array index to the combo labels to know what to show in the textfields?
            ; NOTE: (there are duplicate items in the combobox!)
            
    EndSwitch
WEnd

Any toughs are welcome.

I was thinking about using _GUICtrlComboBox_GetCurSel($Combo) and use that integer to refer to the index (dimension 1) of the array :think:

Thanks, TheAutomator

 

Edited by TheAutomator
not clear enough
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...