Function Arguments
- Last UpdatedOct 24, 2022
- 1 minute read
A function argument is a PML reference to a value or object outside the function. In effect the argument is another name for the original PML variable.
If you define a PML function such as the following:
define function !!ChangeIt ( !Argument is STRING)
!Argument = 'New Value'
$P !Argument
$P !!Global Var
endfunction
Then invoke the function like this:
!!GlobalVar = ‘Old Value’
!!ChangeIt (!!GlobalVar)
The values printed for !Argument and !!GlobalVar will both be 'NewValue'.
Warning:
Be very careful about changing function arguments. It is a powerful feature capable
of causing unexpected results.