NEWBIE QUESTION: ReDim Preserver Multidimensional Arrays ?? 
Author Message
 NEWBIE QUESTION: ReDim Preserver Multidimensional Arrays ??

Thanks for taking the time to look at this:

    Is it possible to ReDim a multi-dimensional array with the Preserve
option?

I can ReDim without error until I add the Preserve option which says
3Subscript out of range2 and points to my ReDim Preserve line.

Thanks for any help,
Christopher Raymond



Wed, 05 Jan 2005 06:45:19 GMT  
 NEWBIE QUESTION: ReDim Preserver Multidimensional Arrays ??

Asked and answered in microsoft.public.scripting.VBScript...

--
torgeir



Wed, 05 Jan 2005 08:01:40 GMT  
 NEWBIE QUESTION: ReDim Preserver Multidimensional Arrays ??
If you use the Preserve keyword, you can resize only the last array
dimension, and you can't change the number of dimensions at all. For
example, if your array has only one dimension, you can resize that
dimension because it is the last and only dimension. However, if your array
has two or more dimensions, you can change the size of only the last
dimension and still preserve the contents of the array.

The following example shows how you can increase the size of the last
dimension of a dynamic array without erasing any existing data contained in
the array.

ReDim X(10, 10, 10)
 . .
ReDim Preserve X(10, 10, 15)

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net



Fri, 07 Jan 2005 20:36:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How handle output to the screen by an external program?

2. Make TPU

3. NEWBIE QUESTION: ReDim Preserver Multidimensional Arrays ??

4. ReDim a Multidimensional Array

5. Multidimensional, multidimensional arrays

6. Modem Routines

7. ReDim arrays Simple QUESTION

8. ReDim Array Question

9. Change Array to Multidimensional Array

10. DBFViewer 2000 v1.2

11. Problem with using DAO 3/3.5 via OLE with Delphi 3.01.

 

 
Powered by phpBB® Forum Software