(Gast)
n/a Beiträge
|
Re: Anzahl Elemente in "set of"
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;
|
|
Zitat
|