Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: recursive program call -> system limits exceeded


From   "Sebastian F. B�chte" <[email protected]>
To   [email protected]
Subject   st: recursive program call -> system limits exceeded
Date   Thu, 1 Feb 2007 14:56:31 +0100

Dear Statalisters,

today I have been working on a little program that contains a recusive
call to itself. While doing so I was wondering whether there is any
practical limit. So I tried the following in a do-file

global callno=0
capture program drop recursive_test
program define recursive_test
    global callno=1+$callno
    di "Call no = $callno"
    recursive_test
end
recursive_test

and here is the ouput (slightly abbridged)




. global callno=0

. capture program drop recursive_test

. program define recursive_test
 1.      global callno=1+$callno
 2.      di "Call no = $callno"
 3.      recursive_test
 4. end

. recursive_test
Call no = 1
Call no = 2
Call no = 3
...
...
...
Call no = 60
Call no = 61
Call no = 62
Call no = 63
system limit exceeded - see manual
r(1000);

end of do-file
r(1000);

No more than 63 recursive calls...So, I checked the manual without
really knowing for what limit I should be looking for. Maybe someone
has an idea.

regards
Sebastian
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index