Good pick. Anyway, we're just discussing other possibilities here. The (myConst1, myConst2, myConst3 = 99, myConst4, myConst5 = 666) construct was just borrowed from C++ to maintain code transparency between the 2 languages. IIRC, it was introduced in Delphi 6.
> --- "Peter W." <[EMAIL PROTECTED]> wrote: > Actually, I was trying out something this > morning, and I think that > I prefer this solution: > > function Test2 : integer; > type > TMyType = (enum1, enum2, enum3); > begin > Result := Ord(High(TMyType)) - Ord(Low(TMyType)) + > 1; > end; > > ... since there is not looping involved. > > ... although technically Ord(Low(TMyType)) is > zero, so, you could > simply use: > > Result := Ord(High(TMyType)) + 1; > > ... even simpler!!! > > Regards, > Peter W. :-))) > Sandy Bay, Hobart, Tas, AU. > > > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ----------------------------------------------------- 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/

