System.TypInfo.SetToString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SetToString(PropInfo: PPropInfo; Value: Integer; Brackets: Boolean): string;
function SetToString(TypeInfo: PTypeInfo; Value: Integer; Brackets: Boolean): string;
function SetToString(PropInfo: PPropInfo; Value: Pointer; Brackets: Boolean = False): string;
function SetToString(TypeInfo: PTypeInfo; Value: Pointer; Brackets: Boolean = False): string;

C++

extern DELPHI_PACKAGE System::UnicodeString __fastcall SetToString(PPropInfo PropInfo, int Value, bool Brackets = false)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.TypInfo.pas
System.TypInfo.hpp
System.TypInfo System.TypInfo

Description

Returns one or more of the set values of a component's property.

SetToString utilises Delphi's RTTI (Run Time Type Information) to retrieve one or more of the values of a component property that is of the set type.

The property to interrogate is defined by a PropInfo record. GetPropInfo and GetPropList can be used to obtain such a record.

Value defines a bit mask that selects the possible values of this property. Each bit corresponds to a set value. The low order bit corresponds to the first set value. A string is returned with the selected set values as a comma separated value string. Note that the current property set values are not taken into account - the set values selected by Value are those in the complete set.

You may optionally set Brackets true so as to enclose this returned string within square brackets, as shown in the IDE for the property.

Note: If the specified property does not exist, or is not a published property, an EPropertyError exception is thrown.

See Also