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.

ProceduresReturning from a ProcedureFor a complete description of the procedure statement, see the LanguageReference <strong>Guide</strong> online help.For more information about local procedures, see Local Procedures (seepage 78).Use the return statement in your procedure to return control to the script orprocedure that called it. In returning control, you can also pass a value back tothe calling script or procedure. The single value that you pass back mustmatch the return value data type that you specified when you created theprocedure. The value is passed back to the caller and assigned as the value ofthe return variable in the calling script or procedure.You can use a procedure that returns a value as an expression by itself or aspart of a larger expression, as described in Procedures in Expressions (seepage 47). The data type of the returned value must be compatible with therequirements of the expression. In the following example, square_root is aprocedure that returns a value.returnfield = square_root(number = 36) * 5;A procedure that returns a value can be used as a parameter value in anotherprocedure. The following is an example of nested OpenROAD procedures:returnfield = p (arg1 = square_root(number = 17));The following example calls the procedure with the name specified in theprocfield field of the current frame and returns a value to the result variable:result = :procfield (x = 5, y = price);If you use the value found in a variable for the procedure name, you must usethe colon. At runtime, the user enters the correct procedure name intoprocfield on the current form, and OpenROAD then calls that procedure.For more information about callproc, see the Language Reference <strong>Guide</strong> onlinehelp.Writing Scripts and Procedures 77

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

Saved successfully!

Ooh no, something went wrong!