%return statement (SDL script)
This topic applies to TDK SDL script extensions. For more information, see Overview of SDL script extensions for TDK (SDL script).
SDL Script Extensions for TDK:
%operation PrintString (%string S)
%if S == "" %then
%m %red "Attempt to print an empty string"
%return; $ Semicolon is mandatory from within an operation
%endif
%m %blue S $ Prints the string
%endoperation

%operation GetRoleName (%object ARole) %return %string
%if ARole:Name != "" %then
%return ARole.Name; $ Semicolon is mandatory from within an operation
%endif
%return ARole->Class:Name $ Semicolon is optional since last operation statement
%endoperation
%return returns from an operation (or a class member operation) to the caller.
An optional expression can be returned.
The %return statement must end with a semicolon after the (optional) expression when %return is not the last statement of the operation, otherwise the semicolon is optional.