Einzelnen Beitrag anzeigen

alex517

Registriert seit: 23. Nov 2004
Ort: Bernau b. Berlin
273 Beiträge
 
Delphi XE5 Enterprise
 
#12

Re: Anzahl Elemente in "set of"

  Alt 8. Apr 2009, 12:35
noch eine Variante
Delphi-Quellcode:
type
  TFontStyle = (fsBold, fsItalic, fsStrikeOut, fsUnderline);
  TFontStyles = set of TFontStyle;

function CountStyles(const AStyles: TFontStyles): integer;
var
  f: TFontStyle;
begin
  Result := 0;
  for f := low(TFontStyle) to high(TFontStyle) do
    if f in AStyles then
      inc(Result);
end;
alex
Alexander
  Mit Zitat antworten Zitat