Previous Next

GetPropertyValue( ) method
Gets a property’s value at run time. Use the GetPropertyValue( )method to access a property’s value dynamically, even if you do not know the property’s name or type when you are using the method at compile time.
Return type:
Access:
Applies to:
Four overloaded versions are supported. The first version operates on a scalar instance property, where the property is any data type that is not, itself, an array.
 
Syntax 
[ return-value = ] class-object-reference:GetPropertyValue ( 
  INPUT object-reference AS Progress.Lang.Object ,
  INPUT property-name AS CHARACTER )
The second version operates on a scalar static property.
 
Syntax 
[ return-value = ] class-object-reference:GetPropertyValue ( 
  INPUT property-name AS CHARACTER )
The third version operates on an instance array or .NET indexed property.
 
Syntax 
[ return-value = ] class-object-reference:GetPropertyValue ( 
  INPUT object-reference AS Progress.Lang.Object, 
  INPUT property-name AS CHARACTER, INPUT index AS any-data-type )
The fourth version operates on a static array or .NET indexed property.
 
Syntax 
[ return-value = ] class-object-reference:GetPropertyValue ( 
  INPUT object-reference AS Progress.Lang.Object, 
  INPUT property-name AS CHARACTER, INPUT index AS any-data-type )
return-value
Specifies an ABL data element, that is assigned the value returned from the property’s GET accessor. This return value can have any valid ABL or .NET method return type. The AVM automatically does the required conversions as if there were a CAST or an ABL conversion function such as STRING or INTEGER present.
class-object-reference
Specifies a reference to an instance of Progress.Lang.Class class; this must be a type that exposes the property. For instance properties, object-reference and class-object-reference must be the same type or one must inherit from the other, and both must either define the property or inherit it.
object-reference
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 overloads of GetPropertyValue( )that take an object reference can be used with a static property by setting object-reference to the Unknown value (?). Alternatively, use the overloads that are designed specifically for static properties.
Note:
A run-time error arises if object-reference does not inherit from class-object-reference, or vice-versa.
property-name
Specifies a CHARACTER name of the property. The AVM evaluates property-name at run time. Note that the property cannot be defined in a built-in type.
index
Specifies an integer expression for the index of the desired element. If the property is a .NET indexed property, index is an expression for the specified element. The index for an indexed property does not have to be an integer.
any-data-type
Specifies the data type of the associated element. The set of possible data types depends on the element. For example, the index of an ABL array element can only be an integer type. However, the return type of a property or array property element can be any ABL primitive data or object type.
See also:

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.