how can i clear the text in lets say "\world\com.txt", however keeping the file there.
Printable View
how can i clear the text in lets say "\world\com.txt", however keeping the file there.
Simply open it for output and then close it.
Code:Open "\world\com.txt" For Output As #1
Close #1
That doesn't seem logical to me, i mean if your just opening a file and then closing it...how did it erase? Thanks though it worked.
Why not you just delete it and reCreate a new one? I think much more faster.
Code:Kill "\world\com.txt"
Open "\world\com.txt" For Output As #1
Close #1
chris, nope, that would be just another operation to perform, exactly the reverse of 'faster'.
Iain is right, because he is opening the file using the OUTPUT keyword, therefore anything between the open and close statements replaces what is already in the file, if there is nothing between the statements, then the file is replaced by a zero-length string. geddit?
Thanks a lot for the explanation, i have a better understanding of the open/close command now. I appreciate it, thanks guys!