Overloading with ANY
- Last UpdatedFeb 08, 2023
- 1 minute read
As with PML Functions, the type of a method argument may be specified as ANY. If method overloading is being used, PML will invoke the method with a matching set of explicitly-typed arguments in preference to calling a method with arguments of type ANY, irrespective of the order the methods appeared in the object definition file:
define method .SetValue( !Argument Is ANY)
define method .SetValue( !Argument Is REAL)
Then:
!SomeObject.SetValue(100)
will invoke the method with the REAL argument, but
!SomeObject.SetValue(‘Priceless’ )
will invoke the method with the ANY argument.