Computer Science Canada Adding onto datafile trouble |
Author: | shoobyman [ Sat Nov 18, 2006 4:00 pm ] | ||
Post subject: | Adding onto datafile trouble | ||
I am sure that this is really simple to fix, but everytime that it writes onto the datafile, it erases what was on it previously (if you run the program more than once). Can anyone tell me how to fix this? |
Author: | Cervantes [ Sat Nov 18, 2006 9:15 pm ] |
Post subject: | |
Go to the [Turing Walkthrough]. Find the tutorial for files. Read it. It will explain that simply writing to the file will erase what is in it previously. You'll have to use mod to append stuff to the end of the file. And if you want to do some more fancy stuff, you'll want to look up tell and seek. |