Thread: Dynamic Arrays
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tushar Mehta Tushar Mehta is offline
external usenet poster
 
Posts: 1,071
Default Dynamic Arrays

There's probably some performance benefit because the compiler/OS
doesn't have to worry about potentially having to resize the array. In
the old mainframe days, there was a way to convince the compiler to
stick the entire array into the stack. Helped speed up a program at
the cost of locking down that much memory.

With modern computers, it probably saves a whole microsecond or two
over the lifetime of a program. {grin}

And, it requires fewer keystrokes, something else that seems to impress
many people.

Finally, an oddity. The Dim part is not necessary. While the
documentation says it is, it is not. Until someone pointed it out,
I've been using Redim without a preceeding Dim blissfully unaware of
the requirement.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Under what circumstances, if any, would one want to code

Dim arr(1 to 20, 1 to 10) instead of

Dim arr
Redim arr(1 to 20, 1 to 10)?

Alan Beban