Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Global variable | Excel Discussion (Misc queries) | |||
Global Variable | Excel Discussion (Misc queries) | |||
Global Variable | Excel Programming | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Declaring variable as a dynamic array? | Excel Programming |