Hi, I momentarily forgot how to do this... It's late in the week. ;)
I have set items in a Set type. How to I count how many items are in the set? eg: TfpgMsgDlgBtn = (mbNoButton, mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); TfpgMsgDlgButtons = set of TfpgMsgDlgBtn; .... var Buttons: TfpgMsgDlgButtons; .... Buttons := [mbRetry, mbIgnore]; // it can be any amount of items. How do I know how many items are in Buttons? Yes I can do a.... for i := Low(TfpgMsgDlgBtn) to High(TfpgMsgDlgBtn) do begin if i in Buttons then int(counter); end; Is there a better/quicker way of doing this? 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