Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q7013 How Do I Re-Dimension Arrays?

irt.org | Knowledge Base | VBScript | Q7013 [ previous next ]

Q7013 How Do I Re-Dimension Arrays?

You may only re-dimension dynamic arrays. To do so, use the ReDim statement in the same manner as either the Dim, Public, or Private statments. For example to re-dimension an existing dynamic array you could go:

		ReDim myArray(5, 5)

Note that using the ReDim statement will reset all data within the array. To keep the data from being erased use the Preserve statement in conjuction with the ReDim statement like so:

		ReDim Preserve myArray(5, 5)

There is no limit to the number of times you can resize a dynamic array, but if you make an array smaller than it was, the data in the eliminated elements will be lost.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.