|
-
Jul 11th, 2000, 12:10 PM
#1
Thread Starter
Frenzied Member
I have this in my code:
Code:
Open "C:\02.dat" For Append As #1
Write #1, txtuser.Text, txtpass.Text
Close #1
now if someone runs the program
it saves to that file
now if someone runs the program again, it adds to the file
how do I make it so that if the person opened the program the second time, it would replace what was already there, instead of add to it?
NXSupport - Your one-stop source for computer help
-
Jul 11th, 2000, 12:14 PM
#2
Hyperactive Member
Don't use the Open...Append.
Instead, try this:
Code:
Open "c:\02.dat" For Output As #1
Write #1, txtuser.Text, txtpass.Text
Close #1
-
Jul 11th, 2000, 12:37 PM
#3
You having file problems again, dimava? 
reeset is correct: When you open for APPEND, lines (records) are added to the end of the file (if the file does not exist, it will be created). When you open for OUTPUT, a new file will be created (or overwritten) every time.
"It's cold gin time again ..."
Check out my website here.
-
Jul 11th, 2000, 12:41 PM
#4
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Jul 11th, 2000, 12:55 PM
#5
Dimava, if you are adding text to a file..say Autoexec.bat, you'd use Append. If you want to write a file or overwrite it, than you would use Output.
Understand? Good .
-
Jul 11th, 2000, 12:58 PM
#6
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
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
|