[icq-devel] Delphi



Massimo Melina rejetto at libero.it
Mon Dec 17 11:21:57 CET 2001


Hello Douglas,

Monday, December 17, 2001, 5:25:58 AM, you wrote:

DM> Ok,  I've  managed  to  learn  enough  of  Delphi  and  change the
DM> writeHexDump procedure to produce output that I like. 16 bytes per

this is the function i use in the last version of &RQ
you can freely use it

function hexDump(data:string):string;
const
  cols=16;
var
  ofs,i:integer;
  s,s2:string;
begin
result:='';
ofs:=0;
while ofs < length(data) do
  begin
  s:='';
  s2:='';
  for i:=1 to cols do
    if ofs+i < length(data) then
      begin
      s:=s+intToHex(ord(data[ofs+i]),2)+' ';
      if data[ofs+i] < ' ' then
        s2:=s2+' '
      else
        s2:=s2+data[ofs+i];
      end;
  s:=s+stringOfChar(' ',4+cols*3-length(s));
  result:=result+s+s2+#13#10;
  inc(ofs,cols);
  end;
end; // hexDump


-rejetto




More information about the icq-devel mailing list