LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default keep recursion result (a dynamic array) without using global variable

Hi there,

I write a recursive subroutine which can be called by several macros
from different modules. I want to keep a dynamic array as a result of
this recursive code. I define an array as a global variant like:
Dim result() as Variant
Redim result(1 to 5, 1 to 20)

And whenever the recursion gets a correct answer, I add it to the
array. The recursion works well when called by its own module. But when
code from other module calls it, I am confused about how to deal with
the global array? Is there any way to keep recursion results without
using global variable?

Can I use a dynamic array parameter and an integer paramter to save its
increasing size like the following?

sub myrecursion(dynArr() as variant, dynArrLen as integer)

Thanks.
lvcha

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Global variable dhstein Excel Discussion (Misc queries) 2 October 30th 09 01:03 PM
Global Variable dhstein Excel Discussion (Misc queries) 4 July 26th 09 05:10 PM
Global Variable Patrick Simonds Excel Programming 8 October 6th 05 12:39 AM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Declaring variable as a dynamic array? aiyer[_44_] Excel Programming 1 August 17th 04 11:01 PM


All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"