Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > redim array of arrays


Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2012, 08:39 AM
wilson208's Avatar
wilson208 wilson208 is offline
Newcomer
 
Join Date: Jun 2011
Location: Northern Ireland
Posts: 15
Default redim array of arrays


Basically i have an array that is declared like the following

dim heats(LBSessionRaces - 1)()

when i redim the array of arrays like so:

redim heats(LBSessionRaces - 1)(x)

will it redim both parts of the array of arrays or just the second part?

Many Thanks, wilson.
__________________
The third-rate mind is only happy when it is thinking with the majority.
The second-rate mind is only happy when it is thinking with the minority.
The first-rate mind is only happy when it is thinking
Reply With Quote
  #2  
Old 07-31-2012, 11:43 AM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,714
Default

What does it matter?
What type is it an array of arrays of.
When you create the array of arrays, you have to initialize the subarrays to an array of something anyway, so I don't know if it makes any sense to Redim the subarray dimension like that since it is meaningless, as far as I'm concerned.
Once you assign the subarray to the main array entry, the dimension you gave the subarray will be what it is, regardless of what you put in the redim statement.
That is the main point of arrays of arrays, it allows ragged arrays (each subarray can be a different dimension).

Perhaps for your needs, what you really want is a 2-dimensional array.
If you declare it as a 2-dimensional array
Dim heats (LBSessionRaces -1,0)

And then later change the size of the second dimension, with the keyword Preserve, then the second dimension will be resized, but the already filled data will remain.
ReDim Preserve heats(LBSessionRaces - 1,x)
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->