setting enumerated types by integer values?

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.
LVL 1
PandoraAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kretzschmarConnect With a Mentor Commented:
? maybe

enum := TEnumeratedType(0);
0
 
geobulCommented:
Yes, exactly. Hi meikl, you are fast :-)

Regards, Geo
0
 
PandoraAuthor Commented:
aha! yes brill, thank you once again Meikl!! P.
0
 
kretzschmarCommented:
hi geo,

i'm not really fast, i'm sometimes a bit lucky :-))
0
 
kretzschmarCommented:
oops,

thanks pandora,
glad to helped you :-))

meikl ;-)
0
All Courses

From novice to tech pro — start learning today.