I am developing a discrete event simulation. Therefore is necessary to recursively call some handler as long as the future event list is not empty. However it is not possible to do this seriously because I permanently get the following error message although I do not reach 400000 recursions:
The handler: doRecursion has reached the recursion limit of: 400000. Execution will be terminated to prevent hang
In order to reproduce the problem, I have written the following code in a button script of a new Stack:
Code: Select all
local sRecursionLoop
on mouseUp
   put 1000 into sRecursionLoop 
   doRecursion
   answer "fertig"
end mouseUp
on doRecursion
   subtract 1 from sRecursionLoop
   if sRecursionLoop > 0 then doRecursion
end doRecursion

