WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Error Codes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Error 3353 Structure Too Complex Recursive UDF

 Keywords: Error 3353 Structure Too Complex Recursive Recurse Recursion User Defined Function UDF Stack

Question:

Below is a simple recursion test. It errors at 100 when I run it. Is this truly the WB limit?
#DefineFunction RecurseLevel(n)
IntControl(73,1,0,0,0)
n1=n+1
RecurseLevel(n1)

:WBERRORHANDLER
Message("",n)
Exit
#EndFunction

RecurseLevel(1)
Exit

Answer:

Yes. WinBatch structure depth is limited to 100 levels. You will need to add code to handle for this possibility.
#DefineFunction RecurseLevel(n)
   Terminate(n>=99,"Notice","About to exceed structure stack limitation")
   n1=n+1
   RecurseLevel(n1)
#EndFunction

RecurseLevel(1)
Exit

Article ID:   W17867
Filename:   Error 3353 Structure Too Complex  Recursive UDF.txt
File Created: 2011:12:12:10:02:00
Last Updated: 2011:12:12:10:02:00