L
lgbjr
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
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