Sets the maximum number of iterations for recursion and loops within an expression.
SetRecursion ( expression ; maxIterations )
expression
- any calculation expression, field, or constant.
maxIterations
- the maximum number of iterations.
text, number, date, time, timestamp, container
FileMaker Pro 18.0 Advanced
By default, the While function and recursive custom functions are each limited to 50,000 iterations. This function allows you to increase or decrease the limit to maxIterations
. If maxIterations
is exceeded, this function will return "?"; otherwise, it returns the result of expression
.
•Custom functions that use non-tail recursion are also subject to maxIterations
specified by SetRecursion. However, they will also terminate and return "?" if the available stack space in memory becomes too small, regardless of SetRecursion.
Returns "?" because the While loop attempts to iterate more than the limit of five times specified by SetRecursion.
SetRecursion (
While (
[ i = 0 ; out = "" ] ;
i ≤ 10 ;
[
i = i + 1 ;
out = out & $variable[ i ] & ¶
] ;
out
) ;
5 )
Returns 100000 because SetRecursion increases the iteration limit to 200000.
SetRecursion (
While (
i = 0 ;
i < 100000 ;
i = i + 1 ;
i
) ;
200000 )