?
Solved

Getting text version of Enum value

Posted on 2009-02-16
3
Medium Priority
?
822 Views
Last Modified: 2013-11-23
Is it possible to get the text version of a enum value:

e.g.

type
 myTypes = (GREEN, RED, BLUE);
..
var
 myType: myTypes;
..
case  myType on
 GREEN:
   ShowMessage(convertEnumToString(myType));  //This should display GREEN
...

0
Comment
Question by:sheepfarmer
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 2000 total points
ID: 23650584
test := GetEnumName(TypeInfo(mytypes), Integer(mytype));
0
 
LVL 38

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 2000 total points
ID: 23650586
it's in unit TypInfo
0
 

Author Comment

by:sheepfarmer
ID: 23650985
Thanks very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question