See recursion
A function can call itself and thereby recurse.
FUNCTION factorial INTEGER (num AS INTEGER).
IF num = 1 THEN
RETURN 1.
ELSE
RETURN num * factorial(num - 1).
END FUNCTION.
DISPLAY factorial(5).
With standard settings (startup parameter) the Progress session wont be able to handle very large numbers in this example. factorial(200)
will fill the stack and raise an error.