2D array of strings problem

February 19th, 2011 - 01:18 am ET by Robert Crandal | Report spam
I have the following erroneous subroutine:

'==Sub DoStuff (A as Integer, B as Integer)

Dim (A, B) as String ' This creates an error!

End Sub
'=
Is it possible to create a 2D array whose size depends
on the values of A and B above? I'm basically
looking for a way to create a 2D array whose
dimensions are not known at runtime. The size
of this 2D array will stay constant for the duration
of the "DoStuff" procedure, so I only need to set
it's size once.

Any ideas?

- Robert
email Follow the discussionReplies 5 repliesReplies Make a reply

Replies

#1 Walter Briscoe
February 19th, 2011 - 02:09 am ET | Report spam
In message of Fri, 18
Feb 2011 23:18:12 in microsoft.public.excel.programming, Robert Crandal
writes
I have the following erroneous subroutine:

'==>Sub DoStuff (A as Integer, B as Integer)

Dim (A, B) as String ' This creates an error!



You have not named that array
Dim X(A, B) as String ' Gets no error


End Sub
'=>
Is it possible to create a 2D array whose size depends
on the values of A and B above? I'm basically
looking for a way to create a 2D array whose
dimensions are not known at runtime. The size
of this 2D array will stay constant for the duration
of the "DoStuff" procedure, so I only need to set
it's size once.

Any ideas?

- Robert





Walter Briscoe

Similar topics