To be able to use a string variable, you need to register TypeInfo with the string in some lookup table, and then view it.
To get all of the listed type names in your list, you can do something like this:
procedure LoadAllEnumValuesIntoStringList(enum: PTypeInfo; list: TStringList); var data: PTypeData; i: integer; begin list.clear; data := GetTypeData(GetTypeData(enum)^.BaseType^); for i := 0 to data.MaxValue do list.add(GetEnumName(enum, i)); end;
source share