|
-
Jun 6th, 2000, 12:01 AM
#1
Thread Starter
Hyperactive Member
how can i clear the text in lets say "\world\com.txt", however keeping the file there.
-RaY
VB .Net 2010 (Ultimate)
-
Jun 6th, 2000, 12:06 AM
#2
Fanatic Member
Simply open it for output and then close it.
Code:
Open "\world\com.txt" For Output As #1
Close #1
Iain, thats with an i by the way!
-
Jun 6th, 2000, 12:12 AM
#3
Thread Starter
Hyperactive Member
Weird
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.
-RaY
VB .Net 2010 (Ultimate)
-
Jun 6th, 2000, 12:16 AM
#4
PowerPoster
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
-
Jun 6th, 2000, 12:22 AM
#5
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?
-
Jun 6th, 2000, 12:41 AM
#6
Thread Starter
Hyperactive Member
ahhhh
Thanks a lot for the explanation, i have a better understanding of the open/close command now. I appreciate it, thanks guys!
-RaY
VB .Net 2010 (Ultimate)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|