Associate
- Joined
- 23 Aug 2004
- Posts
- 1,493
Hey,
basically creating a multiple choice system. I'm storing the results from tests in a file called results.txt. I've setup the file and when it takes a test, it writes to it perfectly. However, when I start a new test, it blanks the file and starts again rather than appending to the file.
I think i need to read the file first and then append to it. Anyone suggest how I'd do that, can't quite figure it out?
Thanks.
----------------------
Solved, just needed to open the file in append mode like this;
basically creating a multiple choice system. I'm storing the results from tests in a file called results.txt. I've setup the file and when it takes a test, it writes to it perfectly. However, when I start a new test, it blanks the file and starts again rather than appending to the file.
I think i need to read the file first and then append to it. Anyone suggest how I'd do that, can't quite figure it out?
Thanks.
----------------------
Solved, just needed to open the file in append mode like this;
Code:
out = new BufferedWriter(new FileWriter("results.txt", true));
Last edited: