Arguments of type ANY
- Last UpdatedNov 10, 2025
- 1 minute read
You may specify ANY as the type of an argument (and even as the type of the function return value).
Note: The use of ANY should be the exception rather than the rule as it switches off argument type checking - an important feature of PML Functions to help ensure correct functioning of your PML.
In the case an argument of type ANY, a value of any type may be passed as the argument to the function:
define function !!Print(!Argument is ANY)
$P $!Argument
endfunction
Where an argument of type ANY is used, you may need to find out its actual type before you can do anything with it. The ObjectType() method can be used for this purpose:
define function !!AnyType(!Argument is ANY)
Type = !Argument.objectType()
if ( !Type EQ 'STRING' ) then
- - do something with a STRING
elseif ( !Type EQ 'REAL' ) then
- - do something with a REAL
elseif ( !Type EQ 'DBREF' ) then
- - do something with a DB Reference
else
- - do something with all other types or give an error
endif
endfunction