3. 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.