AGB  ·  Datenschutz  ·  Impressum  







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

find hex codes in files

Ein Thema von cdkiller · begonnen am 23. Jul 2004 · letzter Beitrag vom 24. Jul 2004
 
scp

Registriert seit: 31. Okt 2003
1.120 Beiträge
 
Delphi 7 Personal
 
#8

Re: find hex codes in files

  Alt 24. Jul 2004, 13:24
You can search for 'AddD ' (If it has not less but more than 3 spaces) then you should read the data into a buffer and find out the postion of the version number if you compare the chars until it is <> ' '.

Delphi-Quellcode:
  ThePos := FindInFile('D:\_ftest.txt', 'AddD ', true);
  fs := TFileStream.Create;
  try
    fs.Seek(ThePos + length('AddD '), soFromBeginning);
    fs.ReadBuffer(Buffer, SizeOf(Buffer));
    i := 0;
    repeat
      Inc(i);
    until (Buffer[i] <> ' ') or (i >= SizeOf(Buffer));
  finally
    fs.Free;
  end;
To find the next entry you should add an additional parameter to FindInFile() which contains the current position in the file.
  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 23:53 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