Einzelnen Beitrag anzeigen

Benutzerbild von Amnon82
Amnon82

Registriert seit: 5. Jan 2005
186 Beiträge
 
FreePascal / Lazarus
 
#11

Re: Bit Operations (Bit in HEX)

  Alt 25. Apr 2006, 10:01
Hmm. Wenn Du willst kannst Du ja die neuste Release näher anschauen.

Ich hab mal das Test.d2v-file mit meiner Routine bis Zeile 16 gescannt. Der erste Wert ist der HEX-Wert, den ich parse. HEXTOINT ist der gleiche Wert umgewandelt in Integer. Danach zurück zu String.

Code:
Bit1 - HEX:   92   HEXTOINT:  146   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  64
Bit1 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  64
Bit1 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  64
Bit1 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  64
Bit1 - HEX:   f2   HEXTOINT:  242   INTTOSTR:  2
Bit6 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  64
Bit1 - HEX:   e2   HEXTOINT:  226   INTTOSTR:  2
Bit6 - HEX:   72   HEXTOINT:  114   INTTOSTR:  64
Bit1 - HEX:   72   HEXTOINT:  114   INTTOSTR:  2
Zum Vergleichen verwende ich:

Delphi-Quellcode:
begin
  value:=GetTok(temp, tempi, ' ');
  if hextoint(value) and $40 > 0
  then
  begin
    thirtytwo:=thirtytwo+1;
    memo1.lines.add('Bit6 - HEX: '+value+' HEXTOINT: '+inttostr(hextoint(value))+' INTTOSTR: '+inttostr($40));
  end;
  if hextoint(value) and $02 > 0
  then
  begin
    wo:=two+1;
    memo1.lines.add('Bit1 - HEX: '+value+' HEXTOINT: '+inttostr(hextoint(value))+' INTTOSTR: '+inttostr($02));
  end;
  if hextoint(value) and $01 > 0
  then
  begin
   zero:=zero+1;
   memo1.lines.add('Bit0 - HEX: '+value+' HEXTOINT: '+inttostr(hextoint(value))+' INTTOSTR: '+inttostr($01));
  end;
  if thirtytwo > 0
  then
  checkbox1.checked:=true
  else
  checkbox1.checked:=false;
  if two > zero
  then
  radiobutton1.checked:=true
  else
  radiobutton2.checked:=true;
  if checkbox3.checked=true
  then
  if i > strtoint(edit14.text)
  then
  exit;
end;
Ich hoffe ich bin nun auf dem Richtigen Weg.

Hier noch mal ein Test.d2v-file:
Angehängte Dateien
Dateityp: 7z vts_01_1_146.7z (1,4 KB, 4x aufgerufen)
  Mit Zitat antworten Zitat