On Mon, 21 Feb 2022, Ryan Joseph via fpc-pascal wrote:



On Feb 21, 2022, at 7:01 PM, Michael Van Canneyt via fpc-pascal 
<fpc-pascal@lists.freepascal.org> wrote:

Yes, this is testbit.

Why do you say it does not work ?

Oh my, I was confusing my terms I think. I wanted to do bit masking (I think it's 
called). I was expecting there to be something like TestFlag in the RTL since I can never 
remember the syntax "Value = (Value or Index)"

function TestFlag(Value: QWord; Index: Byte): Boolean;
begin
 result := Value = (Value or Index);
end;

Hm. I'm not sure that this code does what you need.

But masking is indeed not in the helpers.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to