On Thu, 12 Sep 2002 20:05:45 +0000 (UTC), "David Marfleet"
>I don't think there is any easy way to do this. If the records are of
>variable length, the only obvious solution would be to read the contents of
>the file into a string buffer, omitting the record marked for deletion.
>Then open the file again in binary access mode and paste the contents of the
>buffer into the file using the Put statement. Pretty crude I know, but this
>is low-level I/O we are talking about.
To really read variable length record file safely, use the SEQUENTIAL
Read function. It loads a line taking the vbCRLF as a record
Called SEQUENTIAL because to get one record, you have to go back to
the offset 0 (position 1) then re-read everything. Don't you love
variable lenght records? Actually, it's quite fast.
Comma Separated Values files are parsed that way.
>> I have a urgent problem with a little program I wrote. The program must
>> records from a comma seperated textfile (ascii) and transfer them to a
>> The textfile is also used by a scanprogram, which writes the records to
>> textfiles. The textfile is shared and only a recordlock is placed, when
>> scanprogram writes records to the file.
>> Now I need to read a record (which works with my current textdriver) and
>> delete the record in the textfile. But how can I delete a record in a
>> textfile (1 row). I tried al kind of things but nothing seems to work.
>> Has anyone got any suggestions where to look, it would be very
>> Remco Groot Beumer