ARG_PRESENT
Syntax | Return Value | Arguments | Example | Version History | See Also
The ARG_PRESENT function is useful in user-written procedures that need to know if the lifetime of a value they are creating extends beyond the current routine's lifetime. This can be important for two reasons:
Syntax
Result = ARG_PRESENT(Variable)
Return Value
Returns a nonzero value if the following conditions are met:
In other words, ARG_PRESENT returns TRUE if the value of the specified variable will be passed back to the caller.
Arguments
Variable
The variable to be tested.
Example
Suppose that you are writing an IDL procedure that has the following procedure definition line:
The intent of the RET_PTR keyword is to pass back a pointer to a new pointer heap variable. The following command could be used to avoid creating (and possibly losing) a pointer if no named variable is provided by the caller:
The commands that follow would only be executed if ret_ptr is supplied and will be copied into a variable in the scope of the calling routine.
Version History
See Also
KEYWORD_SET, N_ELEMENTS, N_PARAMS