AGB  ·  Datenschutz  ·  Impressum  







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

HexToBin

Ein Thema von heiopei · begonnen am 19. Sep 2003 · letzter Beitrag vom 19. Sep 2003
Antwort Antwort
heiopei
(Gast)

n/a Beiträge
 
#1

HexToBin

  Alt 19. Sep 2003, 19:08
Abend,
welche werte muss ich bei HexToBin eingeben? - ich finds einfach nicht raus.
(angegeben ist so ungefähr :
hextobin(text, buffer: tchar; buffer_size: irgendwas

danke im vorraus,
heiopei
  Mit Zitat antworten Zitat
anku

Registriert seit: 13. Sep 2003
51 Beiträge
 
#2

Re: HexToBin

  Alt 19. Sep 2003, 20:01
ist das die function aus der Classes.pas?

sie wird in dieser function auf aufgerufen:
(keien ahnung ob dir das jetzt hilft..)
Delphi-Quellcode:
procedure TParser.HexToBinary(Stream: TStream);
var
  Count: Integer;
  Buffer: array[0..255] of Char;
begin
  SkipBlanks;
  while FSourcePtr^ <> '}do
  begin
    Count := HexToBin(FSourcePtr, Buffer, SizeOf(Buffer));
    if Count = 0 then Error(SInvalidBinary);
    Stream.Write(Buffer, Count);
    Inc(FSourcePtr, Count * 2);
    SkipBlanks;
  end;
  NextToken;
end;
MfG
  Mit Zitat antworten Zitat
Benutzerbild von APP
APP

Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: HexToBin

  Alt 19. Sep 2003, 20:25
Hallo,

na das war eine schwere Geburt!

(3 Labels auf die Form)
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);

var
  E: Extended;
  //Make sure there is room for null terminator
  Buf: array[0..SizeOf(Extended) * 2] of Char;
begin
  E := Pi;
  Label1.Caption := Format('Pi starts off as %.15f', [E]);
  BinToHex(@E, Buf, SizeOf(E));
  //Slot in the null terminator for the PChar, so we can display it easily
  Buf[SizeOf(Buf) - 1] := #0;
  Label2.Caption := Format('As text, the binary contents of Pi look like %s', [Buf]);
  //Translate just the characters, not the null terminator
  HexToBin(Buf, @E, SizeOf(Buf) - 1);
  Label3.Caption := Format('Back from text to binary, Pi is now %.15f', [E]);
end;
Quelle: http://delphi.about.com/library/rtl/blrtlHexToBin.htm
Armin P. Pressler

BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
  Mit Zitat antworten Zitat
Antwort Antwort


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 09:09 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