To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
RAISE option signals that, in case of an exception, the problem should be handled not by the local function, but by the calling one.
It means that if an exception happens during a function execution after the WHENEVER [ANY] ERROR RAISE statement was encountered, the function execution terminates and the program control returns to the calling routine, i.e., to the statement following the CALL statement. If the calling routine does not contain an error handler, the error is passed further to the parent function.
The RAISE option can be effectively used with the TRY...CATCH statement. You can place the CALL statement to the TRY block and the RAISE option to the invoked function. If any error occurs during the function execution, the program control will pass to the CATCH block:
MAIN
TRY
CALL do_exception(100, 0)
CATCH
CALL foo()
END TRY
END MAIN
FUNCTION do_exception(a, b)
DEFINE a, b, c INTEGER
WHENEVER ANY ERROR RAISE
RETURN a / b
END FUNCTION
FUNCTION foo()
DISPLAY "Exception caught, status: ", STATUS
END FUNCTION
RAISE action cannot be performed in the REPORT program block.