PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Addressing a named Array

Reply

Addressing a named Array

 
Thread Tools Rate Thread
Old 13-02-2007, 01:30 AM   #1
William Foster
Guest
 
Posts: n/a
Default Addressing a named Array


Good morning all,

Does anyone know how to address a named Array, for instance:

Array_States(1) = "New South Wales"

Array_Name = "Array_States"
Value = Array_Name(1)

Therefore, Value = "New South Wales"

I know that this looks very messy, but hopefully you can understand what
I mean.

Basically I have about 20 or 30 arrays that I want to be able to called
via one procedure, and just change the array that each name that I am
referencing.

Any assistance you may be able to provide would be appreciated.

Yours sincerely,

William Foster

*** Sent via Developersdex http://www.developersdex.com ***
  Reply With Quote
Old 13-02-2007, 01:55 AM   #2
Tom Shelton
Guest
 
Posts: n/a
Default Re: Addressing a named Array

On Feb 12, 6:30 pm, William Foster <nos...@devdex.com> wrote:
> Good morning all,
>
> Does anyone know how to address a named Array, for instance:
>
> Array_States(1) = "New South Wales"
>
> Array_Name = "Array_States"
> Value = Array_Name(1)
>
> Therefore, Value = "New South Wales"
>
> I know that this looks very messy, but hopefully you can understand what
> I mean.
>
> Basically I have about 20 or 30 arrays that I want to be able to called
> via one procedure, and just change the array that each name that I am
> referencing.
>
> Any assistance you may be able to provide would be appreciated.
>
> Yours sincerely,
>
> William Foster
>
> *** Sent via Developersdexhttp://www.developersdex.com***


off the top of my head, I would make use a dictionary or a hashtable
of arrays - depending if the arrays were the same type...

--
Tom Shelton

  Reply With Quote
Old 13-02-2007, 06:45 AM   #3
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Addressing a named Array

William,

Be aware that this is a 24 hours newsgroup not only for New South Wales.

It is hard to understand for me what you want, but the most goes in my idea
the answer on your question to Enum.

http://msdn2.microsoft.com/en-us/li...ystem.enum.aspx


Cor

"William Foster" <nospam@devdex.com> schreef in bericht
news:ud1M75wTHHA.5068@TK2MSFTNGP03.phx.gbl...
> Good morning all,
>
> Does anyone know how to address a named Array, for instance:
>
> Array_States(1) = "New South Wales"
>
> Array_Name = "Array_States"
> Value = Array_Name(1)
>
> Therefore, Value = "New South Wales"
>
> I know that this looks very messy, but hopefully you can understand what
> I mean.
>
> Basically I have about 20 or 30 arrays that I want to be able to called
> via one procedure, and just change the array that each name that I am
> referencing.
>
> Any assistance you may be able to provide would be appreciated.
>
> Yours sincerely,
>
> William Foster
>
> *** Sent via Developersdex http://www.developersdex.com ***



  Reply With Quote
Old 13-02-2007, 08:52 AM   #4
Spam Catcher
Guest
 
Posts: n/a
Default Re: Addressing a named Array

William Foster <nospam@devdex.com> wrote in news:ud1M75wTHHA.5068
@TK2MSFTNGP03.phx.gbl:

> Basically I have about 20 or 30 arrays that I want to be able to called
> via one procedure, and just change the array that each name that I am
> referencing.


How about using dictionarys + lists/arrays instead

For example:

State("New South Wales")(0) = "Some Province/State"
  Reply With Quote
Old 13-02-2007, 11:34 AM   #5
William Foster
Guest
 
Posts: n/a
Default Re: Addressing a named Array

Thanks for the tips everybody, I am interested in the dictionary option,
I haven't used that previously.

I will give it a try tomorrow and call out for more help if I need it (I
am trying to be positive, but I am pretty sure I will need it).

Yours sincerely,

William Foster

*** Sent via Developersdex http://www.developersdex.com ***
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off