Lists in VB? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Lists in VB?

oonamelessoneoonamelessone Posts: 1Member
How can I create paired lists in VB?
for example
myList menu
{
"cereal", "$4.95",
"soup", "$2.50",
"soda", "$0.99"
}
so that:
menu("cereal") would return "$4.95"

Comments

  • GideonOmegaGideonOmega Posts: 617Member
    : How can I create paired lists in VB?
    : for example
    : myList menu
    : {
    : "cereal", "$4.95",
    : "soup", "$2.50",
    : "soda", "$0.99"
    : }
    : so that:
    : menu("cereal") would return "$4.95"
    :
    Do you mean in a ListBox Control?,ComboBox?, SubMenus?
    for listbox and Combobox's you would use the additem command like so

    [code]
    dim strAdd as string
    stradd = "Cereal, $4.95"
    listboxname.additem strAdd
    [/code]
    There are of course many ways you could add your values
    there is also an itemdata property of list and combobox's that will let you put an integer tag with the item( good for accessing table data from a database)

    if it is a submenu your after you can create one by clicking on the right arrow button in the menu creater to indent the item.

    I hope this is what you were asking, I'm a little unsure as it looks like C++ code you have listed above, If I'm wrong post again.


    C:Dos
    C:Dos Run
    Run Dos Run

Sign In or Register to comment.