Can I write "empty" to a text file?

Sarah Reichelt sarahr at genesearch.com.au
Sun Mar 13 22:14:53 EST 2005


> I've got my Rev stack writing data to an external file each time it is 
> used.
>
> Some times the data is 20 lines long some times it is only 10.
>
> I've just realized that IF it had 20 lines previously and this time it 
> only write 10-- lines 11 to 20 from the previous time are STILL in the 
> file! This is a problem.
>
> What's the solution?
> Delete the file prior to opening (recreating) it again?
> Is there an option to put or write empty into a file?
>
Are you using the URL form of file writing or are you opening the file, 
writing to it and closing it again?
I THINK, that if you use the URL command, it will overwrite the current 
contents of the file with whatever you specify, which can be anything, 
including empty
e.g. put empty into URL ("file:" & myFileName)

Cheers,
Sarah



More information about the use-livecode mailing list