Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

setting enumerated types by integer values?

Posted on 2001-08-21
5
Medium Priority
?
141 Views
Last Modified: 2010-04-06
Hiya, just a little one.  Is there anyway to set an enumerated type just by setting its ordinal value?  E.g. for:

type TEnumeratedType = (etype1,etype2,etype3);

where:

var
Enum :TEnumeratedType;

I want to set Enum:=etype1 but only by using its ordinal value of 0. ie I want to be able to effectively set Ord(Enum)=0, if you see what I mean!  Is there anyway to do this (*without* writing a conversion function that converts any given integer to the appropriate TEnumeratedType constant)?  Many thanks, P.
0
Comment
Question by:Pandora
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 6409819
? maybe

enum := TEnumeratedType(0);
0
 
LVL 17

Expert Comment

by:geobul
ID: 6409973
Yes, exactly. Hi meikl, you are fast :-)

Regards, Geo
0
 
LVL 1

Author Comment

by:Pandora
ID: 6410007
aha! yes brill, thank you once again Meikl!! P.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6410011
hi geo,

i'm not really fast, i'm sometimes a bit lucky :-))
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6410033
oops,

thanks pandora,
glad to helped you :-))

meikl ;-)
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

610 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