AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Anzahl Elemente in "set of"

Ein Thema von DevilsCamp · begonnen am 8. Apr 2009 · letzter Beitrag vom 9. Apr 2009
Antwort Antwort
mr_emre_d
(Gast)

n/a Beiträge
 
#1

Re: Anzahl Elemente in "set of"

  Alt 8. Apr 2009, 12:57
probier mal das hier
Delphi-Quellcode:
type
  TFontStyle = (fsBold, fsItalic, fsStrikeOut, fsUnderline);
  TFontStyles = set of TFontStyle;

const
  FS = [fsBold, fsItalic, fsUnderline];

function CntAttr( Fnts: TFontStyles ): Byte;
var
  i: Integer;
begin
  Result := 0;
  for i := 0 to $FF do
    if TFontStyle(i) in Fnts then
      inc( Result );
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ShowMessage( IntToStr( CntAttr( FS ) ) ); // zeig mir 3 an :)
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:47 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz