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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Dimensional Array Question...

Status
Not open for further replies.

eargo

Programmer
Jan 3, 2003
12
GB
Is it possible to ReDim a multidimensional array? Ideally don't want to declare a 100 x 100 element array when I'm only going to use say 30 x 70 elements or something on average. Thanks

 
Yes,
Check out ReDim in Help. There is a caveat if you need to Preserve values in the array as you process. Skip,
SkipAndMary1017@mindspring.com
 
As Skip said, the help section gives you some hints as to how to redim arrays. Note that when redimming you can only change the number of elements in the last array if you want to preserve the contents of the array. i.e. if you have your 100x100 array partially full of data and want to trim it down but keep the contents, you will only be able to redim the array to something like 100x50 or whatever. (not 50x100).

I use a particular method to get around this problem. If you want any further details dont hesitate to ask.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top