I was confused by the function of the number at the end of the following code
lcText = "This is my text"
=STRTOFILE(lcText,'TMP.txt',1)
The 1 retains what is already in the TMP.txt file so that the new text is added to what is already in the TMP.txt text.
I just discovered that using 0 instead will write the TMP.txt anew effectively erasing the existing TMP.txt
.... which is what I was after. Sorry the posting was a bit confused - many thanks for your suggestions.
k
>>What is clearest way to erase a text file (TMP.txt)
>>I have been using this - i'm sure there is a cleaner way to do it.
>>
>>set alte to TMP.txt
>>close alte
>>
>>
>>tnx k
>
>Hm, I'm not realy shure what you are doing.
>
>Your code will not erase anything (from disk)
>
>To delete a file use
>
>DELETE FILE TMP.txt
>
>
>But this will not delete the file if it's open somewhere etc without notice.
>
>In so far it's perfect to CLOSE ALTERNATE a file that is opened with SET ALTERNATE before DELETE FILE.
>
>To just erase some file you do not need do anything with ALTERNATE stuff.
>
>Hint: The four letters abbrevs are a bit outdated this century. What about create your example in VFP + copy & paste? It will autocomplete and beautify a bit - thats much more readable for the audience. :)
>
>Lutz