Skip to content
The Road to Delphi — Delphi, VCL, VCL Styles, UxTheme and WinAPI

Convert String to Enum using Delphi Prism

,

To convert a string in a Enum type, you can use the Enum.Parse function.

See this example

[sourcecode language=”delphi”]
type
Language = (Delphi,Delphi_Prism,CBuilder);

var aLanguage : Language := Language(Enum.Parse(typeof(Language), ‘Delphi’, true));

[/sourcecode]

Leave a Reply