![]() | Programming Guide | ![]() |
Starts a JPL procedure definition
[returnType] procprocName[ ([param[,param]...] ) ]
returnType- Specifies the data type of the procedure's return value. An unqualified
proccommand returns an integer value. You can specify to return a string or double precision value by qualifying theproccommand with the keywordsstringordouble, respectively.procName- A character string that specifies the JPL procedure name. Procedure names can be up to 31 characters long and contain any keyboard character except a blank space. When naming procedures in screen and public modules, be sure to avoid name conflicts, especially with any external modules that you wish to call by name.
param- A parameter to receive the corresponding argument passed by this procedure's caller. You specify parameters as a comma- or space-delimited argument list within parentheses. Panther passes arguments by value–that is, the called procedure gets its own private copies of the values in the calling procedure's arguments. This means that the called procedure cannot directly alter a variable in its caller; it can only alter its own copies.
The
proccommand names a procedure and optionally specifies its parameters and return value's data type. If a module contains multiple procedures, eachprocstatement serves to end the previous procedure. Only named procedures can be called from other procedures, and from application hooks such as control strings and Focus properties.In the following example, the call to procedure
process_inputpasses data from variablesdata1anddata2to the procedure's corresponding parameters. The procedure is defined to return a double value. This return value is used to determine whether the if statement evaluates to true or false:
if process_input(data1, data2) > 0.16667
...
double proc process_input(d1, d2)
vars retval
//process d1 and d2 values
return retvalBecause a
procstatement marks the end of one procedure and the start of another, you cannot embed one procedure definition inside another. Refer to Chapter 19, "Programming in JPL," in Application Development Guide for more information on procedure structure and execution.
call
![]()
![]()
![]()
![]()