PML Customisation
User Guide
Copies and References (for Advanced Users)
: Function Arguments
Function Arguments
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.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.