Reading/Deleting Last Line Of File

Jim Bufalini jim at visitrieve.com
Tue Feb 9 10:08:30 EST 2010


Warren,

> I will give this a try.  I was trying to go down the same path by
> getting the number of records of the file...then trying to determine
> if I could just read the last line and removing the EOF.  Is there
> anyway to specifiy a READ to a certain line of a file without reading
> through the whole file?

The read from file command allows you start at a character offset and then
read to a string, or for a number of bytes/chars/words/items (see
dictionary) or to EOF. The write command will replace from the starting
character offset and move the EOF for you. So, in your case, I don't think
you have to be exact in your read. Just read in close to the end to EOF and
write from the same offset and let the write command handle the EOF for you.

Aloha from Hawaii,

Jim Bufalini




More information about the use-livecode mailing list