Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Bitwise operators
Sun, Jul 31 2016 1:00 PMPermanent Link

thomh

Hi,

I need to turn bits on/off and check if bit is set on an integer. Is this possible in EWB?

// Thom
Sun, Jul 31 2016 1:40 PMPermanent Link

thomh

Never mind, found them.

// Thom
Sun, Jul 31 2016 1:44 PMPermanent Link

Bruno Larochelle

i've done this a few years ago, in Delphi

here is a 'readBit' function that works in EWB. similar technique to get a 'writeBit' function working

there are probably better ways of doing it, but it worked for me Smile

//////////////

function Tform1.readBit(intValue: integer; intBit: integer): boolean;
begin

result := intValue AND round(power(2,intBit));

end;


//////////////



thomh wrote:

Hi,

I need to turn bits on/off and check if bit is set on an integer. Is this possible in EWB?

// Thom

Bruno Larochelle
Logiciels Bitwise Software
Edmonton, AB, Canada
Image