RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TypInfo.StringToSet Function

Returns a bit mask of set values for a set type component property.

Pascal
function StringToSet(PropInfo: PPropInfo; const Value: string): Integer;
C++
int StringToSet(PPropInfo PropInfo, const AnsiString Value);

StringToSet utilises Delphi's RTTI (Run Time Type Information) to return a bit mask of set indices for component's property where that property is a set type.  

The property is defined by the PropInfo pointer. (GetPropInfo and GetPropList can be used to obtain such a record).  

Value defines a comma separated string of set values the property may have.  

The resulting integer value is a bit mask. The 0 bit relates to the 1st set value for the property. If that property value is included in the Value string, it is set to 1, otherwise 0. This continues for bits 1, 2 and so on referring to set positions 2, 3 and so on. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!