Recursion

  • Thread starter Thread starter Mike NG
  • Start date Start date
M

Mike NG

Are there any limits to the depth level of recursion, or is it
determined by memory

Are there any functions you can call like you can in 'C' to see if
you'll have enough free memory to allocate a whole stash of stuff??
 
It is limited by the amount of stack space. To the best of my knowledge,
this is fixed and can not be queried as to how much is used and how much
remains available.
 
Hi Mike,

AFAIK, no such limit has been published.
I have several functions in which the level of recursion is >100 (Markov
chains for disability insurance) and have not experienced any problems so
far.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel
 
Mike NG said:
Are there any limits to the depth level of recursion, or is it determined
by memory

Are there any functions you can call like you can in 'C' to see if you'll
have enough free memory to allocate a whole stash of stuff??

Hi Mike,

Depth of recursion is limited by Excel's available stack space. There
isn't any way to determine the amount of stack space available. There's a
VBA call you can use to determine the amount of system memory available
(Application.MemoryFree), but this reports available system memory, not
internal stack space available.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm
 
Hi Mike,

AFAIK, no such limit has been published.
I have several functions in which the level of recursion is >100 (Markov
chains for disability insurance) and have not experienced any problems so
far.
Great - that should more than cover it then
 
Back
Top