PML Customisation
User Guide
Copies and References (for Advanced Users)
:
Function Arguments
: Constants as Function Arguments
Constants as Function Arguments
Passing a
constant
as a function argument, such as a
STRING
in quotes, means the argument is
read only
and cannot be assigned a new value. So if you define a function
define function !!ChangeString( !Argument is STRING)
!Argument = 'New Value'
endfunction
The following will change the value of
!S
:
!S = ‘Old Value’
!!ChangeString ( !S )
However, the following will result in a PML error message because the value passed to the function as an argument is a
CONSTANT
STRING
value which cannot be modified.
!
!ChangeString ( 'OldValue' )
$* WRONG
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.