setting enumerated types by integer values?
Posted on 2001-08-21
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);
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.