Result := Ord(High(aEnum))-Ord(Low(aEnum))+1

Or use the RTTI (TypInfo unit) and read the
MaxValue/MinValue from type:
var
  Data: PTypeData;
begin
  Data := GetTypeData(TypeInfo(TEnum));
  <you need the Data^.MinValue and Data^.MaxValue>
end

With best regards, Mike Shkolnik
EMail: [EMAIL PROTECTED]
http://www.scalabium.com

--- Andries Bos <[EMAIL PROTECTED]> wrote:
> 
> hello
>  
> How do i get the amount of enumerated types defined:
>  
> Some code:
> type
> SomeEnum = (enum1, enum2, enum3);
>  
> function ABC  : integer
> var AEnum : Someenum;
> begin
> result := ord(high(aEnum))  
> end;
>  
> Result will return the ordinal of the highest, but
> is there a direct way of getting the count of this
> enum list?
>  
> Regards
>  
> andries



                
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to