3. Statements : OpenROAD Language Statements : Callframe Statement
 
Share this page                  
Callframe Statement
This statement opens a new frame in a new window.
This statement has the following syntax:
[returnvariable =] callframe framename([parameterlist])
          [withclause];
The callframe statement transfers control from the current frame to another frame in a new window. The new window covers the window of the calling frame. (The frame that issues the callframe statement is the calling frame, and the frame to which control is transferred is the called frame.) The callframe statement is often used to display dialogs that collect user input relevant to the calling frame.
Because framename is a dynamic name, you can use an actual frame name or a variable that resolves to a frame name at runtime. If you use an actual frame name, OpenROAD resolves the reference at compile time. If you use a variable, OpenROAD resolves the frame reference at runtime. This difference in the timing of name resolution has an important consequence when the callframe statement is executed inside an included application.
Because you can nest called frames, the called frame can call another frame, and so on. You can also call frames recursively.
To exit a called frame, use the return statement. This statement lets you pass a single value back to the calling frame in the return variable. The data type of this variable and the data type of the frame's return value must be compatible. The data types are checked at compile time. (For more information, see the return statement (see Return Statement).)
You cannot use the callframe statement in an expression.