SetPropertyValue( ) method
- Last Updated: January 18, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
The SetPropertyValue( ) method
enables you to assign a value to a property even if you do not know
the property's name or type at compile time.
Return type: VOID
Access: PUBLIC
Applies to: Progress.Lang.Class class
Syntax
Four overloaded versions are supported. The first version operates on a scalar instance property, where a scalar property is any data type that is not, itself, an array.
|
The second version operates on a scalar static property.
|
The third version operates on an instance array or .NET indexed property.
|
The fourth version operates on a static array or .NET indexed property.
|
- class-object-reference
- Specifies a reference to an instance of
Progress.Lang.Classfor a type that exposes the property. For instance properties,object-referenceandclass-object-referencemust be the same type, or one must inherit from the other. 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-referenceto be declared as any object type. At run time, the object type must resolve to the type that exposes the property.GetPropertyValue( )andSetPropertyValue( )work correctly even if the object-reference is not known. Alternatively, use the overloaded methods for static property.Note: The overloads ofSetPropertyValue( )that take an object reference can be used with a static property by settingobject-referenceto 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.
- new-value
- Specifies the value that is assigned to the property. The value is converted at run time to the property's data type using the appropriate data type casting.
- index
- Specifies an integer expression for the index of the specified element of an ABL array property. 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 setting of a property, or array property element, value can be any ABL primitive data or object type.