Question:

Call an array by name not index in VB.net

by  |  earlier

0 LIKES UnLike

Hi I would like to call an value of an array by name. for example.

Blah(0) = jnasjd

Blah(1) = jkasbd

me.textbox0.text = blah(0)

instead I would like to say

Blah(cat) = Tom

Blah(dog) = Jerry

me.textbox1.text = blah(cat)

can this be done?

 Tags:

   Report

1 ANSWERS


  1. Not with a standard array, but you can do it with a specialized collection, such as a Dictionary, NameValueCollection or HashTable.

    Take a look at the System.Collections and System.Collections.Specialized namespaces.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.