473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

dynamically name dynamic arraylists

I would like to have ten arraylists created within a loop.. is there a
conversion or something I can do to acheive this..

pseudo:

Dim counter As Integer = 0
Dim ArrName As ArrayList

'******** LOOP OVER THE VALUES ********************

For Each y in ProvArrList

ArrName = ("Arrname") & counter.ToString
Dim ArrName As New Arraylist ()
counter = (counter + 1)
Next

course this gives me error' Value of type string cannot be converted to
system.collection.arraylist

Is there another way to accomplish this??
tia

Dave

Dec 8 '05 #1
5 2379
Why not add them to a Hashtable?

<dr****@canoemail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I would like to have ten arraylists created within a loop.. is there a
conversion or something I can do to acheive this..

pseudo:

Dim counter As Integer = 0
Dim ArrName As ArrayList

'******** LOOP OVER THE VALUES ********************

For Each y in ProvArrList

ArrName = ("Arrname") & counter.ToString
Dim ArrName As New Arraylist ()
counter = (counter + 1)
Next

course this gives me error' Value of type string cannot be converted to
system.collection.arraylist

Is there another way to accomplish this??
tia

Dave

Dec 8 '05 #2
I need to use Arraylists as I need the data in a specific order.. I
tried using hashtables but the data got all jumbled around.. I tried
using sortedlists as well but it sorted my data... not the way I
needed it.. :o(

or can I store my arraylists inside a hashtable.. hmm I had not thought
of that I'll check it out.. I would have to fill the arraylists before
adding them to the hashtable..

I eventually want to bind 10 different repeaters to the arraylists

thx.

Dec 8 '05 #3
I mean put the ArrayLists in the Hashtable. For instance.

pseudocode:

Create hash table myHT;
for x = 0 to 10
{
Create new array list newList;
Create key to identify array list (key = "array" + x);
Add new list to hashtable (myHT.add(key, newList);
}

// Now you have all the arrays and each hashtable element is your varaible.

<dr****@canoemail.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
I need to use Arraylists as I need the data in a specific order.. I
tried using hashtables but the data got all jumbled around.. I tried
using sortedlists as well but it sorted my data... not the way I
needed it.. :o(

or can I store my arraylists inside a hashtable.. hmm I had not thought
of that I'll check it out.. I would have to fill the arraylists before
adding them to the hashtable..

I eventually want to bind 10 different repeaters to the arraylists

thx.

Dec 8 '05 #4
I'll try that out..

Thx!!

Dec 8 '05 #5
If the key is going to be meaningless, why not simply add them to an
arraylist?

ArrayList list = new ArrayList(10);
for (int x = 0; i < 10; ++x)
{
list.Add(new ArrayList());
}

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:et*************@TK2MSFTNGP14.phx.gbl...
I mean put the ArrayLists in the Hashtable. For instance.

pseudocode:

Create hash table myHT;
for x = 0 to 10
{
Create new array list newList;
Create key to identify array list (key = "array" + x);
Add new list to hashtable (myHT.add(key, newList);
}

// Now you have all the arrays and each hashtable element is your
varaible.

<dr****@canoemail.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
I need to use Arraylists as I need the data in a specific order.. I
tried using hashtables but the data got all jumbled around.. I tried
using sortedlists as well but it sorted my data... not the way I
needed it.. :o(

or can I store my arraylists inside a hashtable.. hmm I had not thought
of that I'll check it out.. I would have to fill the arraylists before
adding them to the hashtable..

I eventually want to bind 10 different repeaters to the arraylists

thx.


Dec 8 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohan | last post by:
Hi, In my application, I need to increase the 2-dimensional array size dynamically. Please let me know the procedure to declare a dynamic 2-dimensional array like Single dimensional array,...
6
by: TB | last post by:
Hi All: I have this page where a rows / cells are programmatically added to to table by pushing a button. The rows contain a textbox and a associated button. What I want to is to be able to...
7
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the...
1
by: adamredwards | last post by:
I have a page with some form elements that are dynamically generated. They are inserted into the dom by first cloning a node, changing the values like name, and then inserted with insertBefore(). ...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
4
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays...
12
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the...
4
by: AMP | last post by:
Hello, I have ArrayLists that are Channel1, Channel 2......Channel16 I want to access them with a (for int s=1;s<17;s++) loop, but I dont know how to do this: "Channel+s" Any help, Thanks Mike
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.