On 10/01/2008, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> >
> >  for i := Low(TfpgMsgDlgBtn) to High(TfpgMsgDlgBtn) do
> >  begin
> >     if i in Buttons then
> >         inc(counter);
> >  end;
> >
> > Is there a better/quicker way of doing this?
>
> No.
> You can try casting to an integer and count all set bits, but that's
> highly non-portable and will not work for all sets.

[ Wow, a quick response! ]

OK, thanks Michael.  The for loop actually gives me time to extract
the correct string (text) for each enum type at the same time, so it
ends up being handy after all.  I just wasn't sure if there was a
different way to do it.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to