Re: Use a variable to call an arraylist
- From: "lgbjr" <lgbjr@xxxxxxxxxx>
- Date: Sat, 8 Oct 2005 22:48:09 +0800
It's obvious that I haven't had enough caffiene yet!!
I don't know how DirectCast(alName,ArrayList).DoArrayListStuff slipped my
mind!
cheers
Lee
"lgbjr" <lgbjr@xxxxxxxxxx> wrote in message
news:e3D4vXBzFHA.2540@xxxxxxxxxxxxxxxxxxxxxxx
> Hi All,
>
> I have 10 arraylists in a VB.NET app. Based on the state of various
> checkboxes and radiobuttons, a set of data is read into these arraylists.
> I don't know how many of the arraylists will be used until runtime. what
> I'd like to do is something like this:
>
> Dim AL1 as New ArrayList
> ..
> Dim AL10 as New ArrayList
> Dim alName as string
> Dim i, j as Integer
> i = some number between 1-10 '(determined by user selections)
> For j = 1 to i
> alName="AL"+j.ToString
> ' ***Something that uses the value of alName to call the appropriate
> ArrayList***
> ' ***Code to add the right stuff to the right ArrayList***
> Next j
>
> does that make sense? I know I can use a bunch of If..Then..ElseIfs, but I
> thought the above method would be a bit more elegant.
>
> TIA
> Lee
>
.
- Follow-Ups:
- Re: Use a variable to call an arraylist
- From: lgbjr
- Re: Use a variable to call an arraylist
- References:
- Use a variable to call an arraylist
- From: lgbjr
- Use a variable to call an arraylist
- Prev by Date: determine if 2 IP's are on the same subnet?
- Next by Date: Re: Visio events (C# to VB translation)
- Previous by thread: Use a variable to call an arraylist
- Next by thread: Re: Use a variable to call an arraylist
- Index(es):