Computer Science Canada Im confused on how to output data to a txt file..... |
Author: | INFERNO2K [ Mon Jun 09, 2003 6:04 pm ] | ||
Post subject: | Im confused on how to output data to a txt file..... | ||
I have a game and I want to output the players name and his score next to his name
I tried this but it doesnt work. Also how would I be able to keep this txt file and everytime I run this program it will add a new line instead of replacing the existing information? Thanks |
Author: | Tony [ Mon Jun 09, 2003 6:06 pm ] |
Post subject: | |
read tutorial on writing to files. if you're opening for put/get you use put get, NOT write/read |
Author: | INFERNO2K [ Mon Jun 09, 2003 6:10 pm ] |
Post subject: | |
I've tried and all I get is a Cent symbol, C with a dash through it in the text file. |
Author: | INFERNO2K [ Mon Jun 09, 2003 6:25 pm ] | ||
Post subject: | |||
Ok I simply used
Now Im confused on how I can keep that file and the program uses it to add onto it instead of replacing the original text. |
Author: | PaddyLong [ Mon Jun 09, 2003 7:15 pm ] | ||
Post subject: | |||
open it with mod and seek as well you really should read the help file for open and read the things listed under "see also" because it lists all the parameters (just type open in your editor, put the cursor on it and press f9 or just open the help and search for open) any way for your purposes I believe this is what you want...
|
Author: | Andy [ Mon Jun 09, 2003 7:18 pm ] |
Post subject: | |
close the file at the end close (file) |
Author: | PaddyLong [ Mon Jun 09, 2003 7:37 pm ] |
Post subject: | |
that too |
Author: | Homer_simpson [ Mon Jun 09, 2003 9:05 pm ] | ||
Post subject: | |||
this code simply reads and prints text.txt
|