10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Invoke FramesHow You Can Return a Value from an Active Child to the Inactive ParentOne feature of the callframe statement is its ability to pass a return value fromthe called frame to the calling frame using the return statement.When you use the return statement in a frame that was opened with thecallframe statement, you can pass a single value back to the calling frame.This enables the calling frame to get information back from the frame that itcalled. For example, you can use the return statement to send back a statuscode, which the calling frame can then use in conditional processing.When you issue the original callframe statement, you must specify a variablename to receive the return value. The syntax is:variable = callframe framename ([parameterlist])variableSpecifies any variable within the scope of the calling component, includinga field variable or a local variable declared in the initialize or declareblocks. The data type of the variable must be compatible with the returnvalue data type you specified when you created the frame with theOpenROAD Workbench.Then, in the return statement, you must specify the return value. The syntaxis:return expressionexpressionSpecifies any variables, constants, or expressions from the called frame.The value of the expression must be appropriate for the return data typeof the called frame.For example, in the following callframe statement, id is an integer variable:id = callframe fakeframe;The following return statement passes the integer value back to the frame thatissued the callframe statement:return 33;How You Can Pass Parameters Between an Active Child and Inactive ParentAnother feature of the callframe statement is its ability to pass parameters byreference as well as by value. To pass a parameter by value, simply specify theparameter name and assign a value to it in the parameter list of the callframestatement.<strong>Programming</strong> Frames 101

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!