Unit 'TypInfo' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#rtl]

StringToSet

Convert string description to a set.

Declaration

Source position: typinfo.pp line 1349

function StringToSet(

  PropInfo: PPropInfo;

  const Value: string

):LongInt;

function StringToSet(

  TypeInfo: PTypeInfo;

  const Value: string

):LongInt;

procedure StringToSet(

  PropInfo: PPropInfo;

  const Value: string;

  Result: Pointer

);

procedure StringToSet(

  TypeInfo: PTypeInfo;

  const Value: string;

  Result: Pointer

);

Description

StringToSet converts the string representation of a set in Value to a integer representation of the set, using the property information found in PropInfo. This property information should point to the property information of a set property. The function returns the integer representation of the set. (i.e, the set value, typecast to an integer)

The string representation can be surrounded with square brackets, and must consist of the names of the elements of the base type of the set. The base type of the set should be an enumerated type. The elements should be separated by commas, and may be surrounded by spaces. each of the names will be fed to the GetEnumValue function.

For an example, see SetToString.

Errors

No checking is done to see whether PropInfo points to valid property information. If a wrong name is given for an enumerated value, then an EPropertyError will be raised.

See also

GetEnumName

  

Return name of enumeration constant.

GetEnumValue

  

Get ordinal value for enumerated type by name.

SetToString

  

Convert set to a string description.


Documentation generated on: Dec 21 2024