« Reply #4 on: January 28, 2022, 02:16:31 pm »
abc :=TLEDShape( GetEnumValue(TypeInfo(TLEDShape), 'lsUp'));
program Project1;
Uses TypInfo;
Type
TLEDShape = (lsRect, lsCircular, lsLeft, lsRight, lsUp, lsDown, lsDiamond, lsStar);
Var
abc:TLEDShape;
s:String;
i:Integer;
begin
s:=GetEnumName(TypeInfo(TLEDShape),4);
Writeln(s); //prints lsUp
i:=GetEnumValue(TypeInfo(TLEDShape),s);
Writeln(i); //prints 4
abc:=TLEDShape(i);
Writeln(abc); //prints lsUp
end.
« Last Edit: January 28, 2022, 02:23:21 pm by Zvoni »
Logged
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad