write to file command

yves COPPE yvescoppe at skynet.be
Mon Feb 11 17:15:01 EST 2002


hello,


in the transcript dictionary, we find  :


If the file already exists, the write to file command does not remove 
characters from it. For example, if the file is 100 characters long, 
and you write a value 60 characters long to the start of the file, 
the file now contains the 60 characters of the value, followed by the 
last 40 characters of the original file.


So, if I want my text replace the previous one I must write something like


if there is a file filename then
delete file filename
end if
open file filename
write date to fiel filename
close file filename


the 3 first lines make sure there will be none char over from the 
previous written data

Is there any other way to write data to a file without having any 
chars over from the previous record ?
Or
I only can perform it deleting the previous file ?

thanks.
-- 
Greetings.

Yves COPPE

Email : yvescoppe at skynet.be



More information about the Use-livecode mailing list