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.
Data type returned
text, number, date, time, timestamp, container
Originated in version
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 is exceeded, this function will return "?"; otherwise, it returns the result of
- Custom functions that use non-tail recursion are also subject to
maxIterationsspecified 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.
[ i = 0 ; out = "" ] ;
i ≤ 10 ;
i = i + 1 ;
out = out & $variable[ i ] & ¶
Returns 100000 because SetRecursion increases the iteration limit to 200000.
i = 0 ;
i < 100000 ;
i = i + 1 ;