System.TypInfo.GetPropValue
From RAD Studio API Documentation
Delphi
function GetPropValue(Instance: TObject; const PropName: string; PreferStrings: Boolean): Variant; function GetPropValue(Instance: TObject; PropInfo: PPropInfo; PreferStrings: Boolean): Variant;
C++
extern DELPHI_PACKAGE System::Variant __fastcall GetPropValue(System::TObject* Instance, const System::UnicodeString PropName, bool PreferStrings = true)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.TypInfo.pas System.TypInfo.hpp |
System.TypInfo | System.TypInfo |
Description
Retrieves a component's property value as a variant.
GetPropValue utilises Delphi's RTTI (Run Time Type Information) to retrieve a component property as a variant.
In one form of this function, the object Instance's property is defined by a PropInfo record. GetPropInfo and GetPropList can be used to obtain such a record.
In the other form of this function, the name of the property, PropName, is explicitly given.
In both forms of the function, the value of the specified property is returned as a variant.
The PreferStrings parameter specifies whether string representation should be used when getting property values of types enumeration or set.
Note: If the specified property does not exist, or is not a published property, an EPropertyError exception is thrown.