Hi
I have Googled for a reply to this, but most of the answers seem to relate to either a) not using file streams but instead using the older methods of AssignFile, EOF, BlockRead, BlockWrite etc etc whereas I need to use streams (as per the guidance in the Lazarus notes when reading binary data -
http://wiki.freepascal.org/File_Handling_In_Pascal..."
For opening files for direct access TFileStream should be used.") or b) they relate to finding one value and then stopping.
In my case, I need to code an app that wil
a) Read a binary data file from start to end
b) On the way, if a magic file marker is found, I need it to then read in 1019 bytes (1024 less the 5 byte magic marker) and 'do stuff' with the values in between.
c) Once the end of the file is reached, I need the found values to be output to a memo list.
I don't expect anyone to give me pseudo code for this but what I was hoping for was an example somewhere on the net where the same kind of thing is done using ideally Free Pascal and Lazarus, though a Delphi example would also suffice.
I posted the following question on StackOverflow (
http://stackoverflow.com/questions/9944550/using-free-pascal-lazarus-to-parse-a-large-binary-file-for-specific-values) which shows the code I have so far, if that helps or if anyone can give me some guidance as to whether I'm on the right tracks.
Ted