Language Reference Guide : Statements : OpenROAD Language Statements : Return Statement
 
Share this page          
Return Statement
This statement closes the current frame or called procedure and returns to the calling frame or procedure.
This statement has the following syntax:
return [expression];
The return statement closes the current frame, procedure, or method, and returns the user to the calling frame, procedure, or method.
For a frame called by a callframe statement, the return statement closes the frame and returns control to the calling frame, procedure, or method at the statement following the callframe statement. If the frame was initiated through an openframe statement, the return statement only closes the frame. The user must then initiate interaction (by selecting a field or menu item) with an active frame.
Upon returning from a called procedure or method, the return statement passes control back to the calling frame, procedure, or method, which resumes execution at the statement following the callproc statement or method invocation.
If the frame, procedure, or method issuing the return statement has been specified as the parent of any opened frames, OpenROAD sends these frames a Terminate event and then closes them.
If all other active frames and procedures are children of the called frame, procedure, or method, the return statement closes the entire application, functioning, in effect, as an exit statement.
The return statement can pass a value such as a return status back to the calling frame, procedure, or method. If a frame has been called with the openframe statement, then any return value is ignored.
Parameters--Return Statement
This statement has the following parameter:
expression
Specifies a value returned to the calling frame or procedure when the return statement is executed and closes the called frame or procedure. The value must have a data type compatible with the return data type of the called frame, global procedure, or method as defined in the visual development environment when you create the frame, global procedure, or method.
For a return in a local procedure, the value must have a data type compatible with the declaration of the local procedure.
The value of expression can be a reference variable to return an object.
Example--Return Statement
At the end operation, return control to the calling frame, passing back the value in the status variable:
on click file.end =
begin
     return status;
end