Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Mucking with text files...

Author
Message
Chily Dog
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: U.S.A.
Posted: 17th Aug 2007 22:04 Edited at: 17th Aug 2007 22:05
alright, so by now I have gotten down the commands to write and read from a text file, but how do you get the strings you write to stay there?

so with this code


Where the test file only contains the line "Data" to start with.

how come "another bit of data" is not in the text file when re-opened outside the program?
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 18th Aug 2007 00:06
You have to delete the file before writing something. So if you want to add something to your file, you must record all it's data, delete the file, and finally rewrite it with your new string.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Chily Dog
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: U.S.A.
Posted: 18th Aug 2007 00:27
thanks guys, I got it from here

Login to post a reply

Server time is: 2024-11-26 11:51:35
Your offset time is: 2024-11-26 11:51:35