Computer Science Canada How do u put stuff into a text file! |
Author: | nate [ Sun Jun 15, 2003 7:10 pm ] |
Post subject: | How do u put stuff into a text file! |
Like you get a value and then you put that value into the file! |
Author: | hskhan [ Sun Jun 15, 2003 7:24 pm ] | ||
Post subject: | |||
|
Author: | nate [ Sun Jun 15, 2003 7:31 pm ] |
Post subject: | |
don't you have 2 close the file at the end!? |
Author: | hskhan [ Sun Jun 15, 2003 7:36 pm ] | ||
Post subject: | |||
nate wrote: don't you have 2 close the file at the end!?
wopdie do.
|
Author: | naoki [ Sun Jun 15, 2003 9:35 pm ] |
Post subject: | |
i'm too lazy to check if it errors, but i'm pretty sure you can't put to a file like that going "put: stream, name : *" is wrong, you don't need the * when putting, only when you get a string |
Author: | Martin [ Sun Jun 15, 2003 9:43 pm ] | ||||||||
Post subject: | |||||||||
Yeah, the above isn't goign to work at all. Here's how you do it.
That's file input suppose your file looked like this:
x would have a value of 1 (the first integer, y would have a value of "2 3", and z would have a value of 'hello' for file output, you do the following
outputfile.txt now looks like this:
Also, if outputfile.txt doesn't exist it will be created. If it does exist, opening it for put will delete it and replace it with a new blank file. Hope that clears it up. |