From: Rich Date: 2003-12-21T14:09:37+09:00 Subject: Re: How do you set the stack level on Windows? Thanks for the quick response!! I actually walked away for a few hours and get the solution... use the existing each_line method. :-) Now I've got an FXTreeList that displays basic XML nesting! All within the first 2 days of seeing FOX... I'm very impressed. -Rich ----- Original Message ----- From: "Lyle Johnson" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Saturday, December 20, 2003 10:36 AM Subject: Re: How do you set the stack level on Windows? > Rich wrote: > > > I'm wanting to not get the error - 'SystemStackError' ... > > Is there any way to make populateDisplay() non-recursive? It looks like > you're exceeding the Ruby interpreter's stack size limit, which is not > too hard to do. For example, consider this watered-down version: > > def populateDisplay(depth) > puts "depth = #{depth}" > populateDisplay(depth + 1) > end > > populateDisplay(0) > > Now if I run this, I get: > > depth = 0 > depth = 1 > depth = 2 > depth = 3 > depth = 4 > ... > depth = 1251 > depth = 1252 > depth = 1253 > populateDisplay.rb:2:in `populateDisplay': stack level too deep > (SystemStackError) > > Now, if you don't think the data in your XML file is nested that deeply, > and thus your program should not be recursing that deeply, it may > indicate some other error in populateDisplay(). > > Hope this helps, > > Lyle > >