AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Informationen aus Byte

Ein Thema von eisbar · begonnen am 19. Jan 2007 · letzter Beitrag vom 20. Jan 2007
 
shmia

Registriert seit: 2. Mär 2004
5.508 Beiträge
 
Delphi 5 Professional
 
#5

Re: Informationen aus Byte

  Alt 19. Jan 2007, 16:22
Hier mal eine Funktion aus der JCL (eine wahre Schatzkammer):
Delphi-Quellcode:
// Auszug aus Unit JclLogic.pas
// [url]http://sourceforge.net/projects/jcl[/url]
const
  // Constants defining the number of bits in each Integer type
  BitsPerByte = 8;
type
  TBitRange = Byte;
function TestBit(const Value: Byte; const Bit: TBitRange): Boolean;
begin
  Result := (Value and (1 shl (Bit mod BitsPerByte))) <> 0;
end;
Mit TestBit kann man jedes Bit prüfen:
if TestBit(meinByte, 7) then ShowMessage('höchstwertiges Bit gesetzt');
Andreas
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:47 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz