Returns the value of a class property. The function allows you to refer to a class property by providing a character expression for the property name, along with an object reference, THIS-OBJECT system reference, or the name of a class. The compiler supports both ABL user-defined types and .NET types for the object reference or class name.
Note: The DYNAMIC-PROPERTY function also works with .NET indexed properties. Normally, ABL allows you to refer to a .NET indexed property without using the property name, but for dynamic access you must use the property name, typically Item indexed property.
return-value = DYNAMIC PROPERTY(object-reference class-type-name , property-name , index )Specifies a data element that is assigned the value returned when you execute the property's GET accessor. This return value can have any valid ABL or .NET method return type. The AVM does the required conversions automatically as if there were a CAST or an ABL conversion function such as STRING or INTEGER present.Specifies a reference to an ABL or .NET class instance that exposes the specified property as an instance member. The compiler allows object-reference to be declared as any object type. At run time, the object type must resolve to the type that exposes the property.
Note: The function generates a run-time error if the property-name does not name a property exposed by the object-reference or a static property exposed by class-type-name. A run-time error also gets generated when the required property accessor is not accessible or does not exist. For example, an error is generated when there is an attempt to get the value of a protected property outside the class hierarchy where it is defined, or there is an attempt by the AVM to set a property that has no SET accessor.Specifies an integer expression for the index of the specified element. Use index to set or retrieve an individual array element. You can also operate on an entire array by removing the index the same way as you work with non-dynamic property access.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |