Recursion Clarification

Started by JTaylor, May 07, 2020, 07:57:54 PM

Previous topic - Next topic

JTaylor

I have script where I do some recursion.   I pull up a set of data and run it through my function and all works great.   I pull up the next set of data and run it through the function but it tells me that the Nesting of Structures is too complex.   As far as I can tell it has backed out of all but about 4 levels at the time of the error.

My [silly?] question is, does it keep some type of cumulative counter or should it have restarted with the beginning of the new batch?   My first batch was probably more complex than the second.   Have spent a lot of time going through the data and script but cannot see why it fails.  I can even change the batch of data that I use and get the same results.  Even with a batch that has only one level of recursion.

Suggestions?

Jim

td

A lot of times this kind of error is the result of a missing "endif" or some other block termination keyword so that the block doesn't get cleaned off the stack. 

I know that is not a very clear explanation ( I should already be asleep by now) but try running the syntax checker on your script to see if it finds anything.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor


JTaylor

Was a GoTo statement.   Couldn't see an alternative at the time but with a little creative IF and WHILE work I got it sorted.  Thanks again.

Jim

td

I misspoke a bit.  The goto statement is the most common cause of the error. Missing block terminators are the second most common cause of the error.  The later is much harder to find and is one of the justifications for the creation of the Syntax Analyzer.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Yeah...I try to never use GOTO.

Jim