Caché Basic Reference
Return
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Exits from the current function and returns a value from that function.
Synopsis
Return expression
Arguments
The Return statement syntax has these parts:
expression Any numeric or string expression.
Description
You use the Return statement to stop execution of a function and return the value of expression. If no Return statement is executed from within the function, the expression that called the current function is assigned the value undefined.
Examples
The following example illustrates the use of the Return statement:
Function IsGreaterThan(lower, upper)
If lower > upper Then
    Return False
ElseIf lower = upper Then
    Return False
Else 
    Return True
End If
End Function
See Also