Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Object-Pascal / Delphi-Language (https://www.delphipraxis.net/35-library-object-pascal-delphi-language/)
-   -   Delphi Bits and Bytes - Quick-Tutorial by sakura (https://www.delphipraxis.net/2581-bits-bytes-quick-tutorial-sakura.html)

Luckie 30. Jan 2003 10:16


Bits and Bytes - Quick-Tutorial by sakura
 
Code:
Bit1 | Bit2 || AND |  OR | XOR
  0  |   0  ||  0  |  0  |  0 
  1  |   0  ||  0  |  1  |  1 
  0  |   1  ||  0  |  1  |  1 
  1  |   1  ||  1  |  1  |  0 

Bit | NOT
  0  |  1 
  1  |  0 

Setzen eines Bits (BitIndex basierend auf 0)
Byte := Byte or (1 shl BitIndex)

Löschen eines Bits (BitIndex basierend auf 0)
Byte := Byte and (not (1 shl BitIndex))

Switchen eines Bits (BitIndex basierend auf 0)
Byte := Byte xor (1 shl BitIndex)


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:42 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz