FUNCTION / RETURN
Try it yourself →Subroutine that returns a value.
Syntax
FUNCTION name(p) ... RETURN value
Description
Defined with FUNCTION, returns a value with RETURN. PROCEDURE does not return a value.
Example
? Square(5) FUNCTION Square(x) RETURN x * x
Expected output
25
When to use?
Preventing code repetition.