Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically creating multiple arrays at Runtime

Status
Not open for further replies.

newora

Programmer
Aug 19, 2003
133
GB
Hi There,

I wonder if somebody could please point me in the right direction - I have been out of the VB .NET arena for some time and I am having a bit of trouble with creating arrays on the fly.

The basic task that I need to perform is that I need to dynamically create a number of arrays, based upon a value that is retrieved from a datbase lookup.

Thus if I retrieve a value of 5 back from the database lookup, I need to create 5 arrays, named x1 to x5.

My basic pseudo code at the moment is :-

' clscrew.number_of_crews is primed via a db lookup
for i = 1 to clscrew.number_of_crews
x? = System.Array.CreateInstance(GetType(integer),20))
next

My main problem is in trying to create the name of the array (which is why I have used the ? in the above example)i.e. x1,x2,x3,x4,x5 variable that will be assigned to the createinstance of the array.

Many thanks for you help.

Andrew
 
That would be a silly thing to do. Just put your arrays in an arraylist and be done with it.

Christiaan Baes
Belgium

My Blog
 
OK thanks - arraylists never entered by head.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top