Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips


#54: How can I get a name of enumerated value?

For example, if you have the some enum type

TyourEnumType = (One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten)

and you want in run-time to get a string with same value for each of them (for example, fill the combobox items with enum values), then you can use the next procedure:

uses TypInfo;

var i: Integer;
begin
  for i := Ord(Low(TyourEnumType)) to Ord(High(TyourEnumType)) do
    Combobox1.Items.Add(GetEnumName(TypeInfo(TyourEnumType), i));
end;


Published: December 21, 1999

See also
 
Paradox Viewer
DBISAM Viewer
Viewer for MS Outlook Messages
Paradox to Text converter
DBISAM Password Recovery
Clarion Viewer
ABA Picture Convert
Paradox Password Recovery
Fast Document Viewer
Mail parser (ActiveX)
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2021, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising