Skip to content

GetPropValue

Return a property value as a variant

Declaration

Source position: variants.pp line 345

  function GetPropValue(Instance: TObject; PropInfo: PPropInfo; 
                       PreferStrings: Boolean) : Variant;  Overload;

Description

GetPropValue returns the value of the property described by PropInfo from the Instance. The property value is returned as a variant type.

when PreferStrings is true, the implementation will tend to cast to a string-valued variant when a conversion must be done.

This function is used as the value for the TypInfo unit's OnGetPropValue callback. This callback is automatically initialized with the function when the variants unit is used.

See also

Name Description
SetPropValue Set a property value as a variant
TypInfo Access Run-Time Type Information (RTTI)
TypInfo.OnGetPropValue Callback to get a property value as a variant.