Edit1Edit2a 3rd text string
Title Text,Image path location
I was thinking CSV for the end game, but decided that using ',' isn't a good idea, because if you want to store a sentence that has a "," in it, then you will get an un-wanted break in the sentence, thus breaking the CSV fields.
You know there are ready made system calls that do this for you?
ReadLn, WriteLn, etc...
But in any case...
You write out the EDITS one by one but you have no markers (line endings) embedded in the file so when you
go and read it back, the SIZE reported is the sum of all.
In this case here, you have set three sizes from one source, the first read you do is going to read the complete file in
and the others will read nothing because you have moved to the end of the file on the first one.
If you are trying to make some custom format then you need a different approach.
Try this for an idea...
each time you write a string out you first write out a 2 byte value that indicates the length of the following string and use
that to read in that amount of data.
After the first read in, the file pointer will be sitting on the next 2 byte value that reports the length of the next string so
you repeat the cycle.
But honestly if all you want to do is read and write text lines you can use the built in PASCAL IN/OUT functions
Filevar :Text;
AssignFile(FileVar, 'FileName');
Rewrite(fileVar);
WriteLn(FileVar, EDIT1);
Writeln(FileVar, EDIT2); and so on..
CloseFile(fileVar);
For reading you use RESET(fileVar).
and Readln etc...
I was thinking CSV for the end game, but decided that using ',' isn't a good idea, because if you want to store a sentence that has a "," in it, then you will get an un-wanted break in the sentence, thus breaking the CSV fields.
In CSV you surround those strings with quotes:
"A string, with a comma",12345,normal string
You do know that the LazUtils package has some CSV-related goodies, don't you?