Use GetEnumName to determine whether the input strings match, and then return the enumeration value.
use
TypInfo
type
TTest = (a, b, c, d, haha, yeah);
Program TForm 1. Button 1Click (sender: toobject);
defined variable
ti:PTypeInfo;
TD:PTypeData;
I: integer;
begin
ti:= type info(TTest);
TD:= GetTypeData(ti);
Because I: = MinValueMaxValue do of TD. TD.
List box 1. Items.Add(GetEnumName(ti,I));
End;