Article

From:
To:
Philippe Ranger
Subject:
Re: Cardinality of a set
Newsgroup:
borland.public.delphi.objectpascal

Re: Cardinality of a set

Merci Philippe,

As you say I think it would be usefull if we could have such a function.
Now, a question about your function. If I declare something like:
Type   TDigits = set of 0..9; Var   Digits : TDigits;   Cardin: integer;
I would call your function like this:
  Cardin := Card( Digits, sizeof(TDigits) ); or   Cardin := Card( Digits, 2 );
Which means that size is the size in bytes (not in bits) occupied by the variable.
Jacques

Philippe Ranger <.> wrote in message news:7u3nf6$✉forums.borland.com...
> There is no built-in function and, like you, I think there should be, just
> as there should be sets beyond 256 elements. Many years ago, I wrote a
> universal bit counter, which follows.
> ---------------
> FUNCTION card (var tar; size: integer): integer; assembler; file://tested
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Tue, 26 Nov 2024 11:52:07 UTC
Copyright © 2009-2024
HREF Tools Corp.