RE: [Wtr-general] Writing values to a file

2005-08-25 Thread Kingsley
:21 To: 'wtr-general@rubyforge.org' Subject: RE: [Wtr-general] Writing values to a file f = File.new("testfile.txt", "a") f.puts t1.to_s f.puts t3.to_s -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tonny Brown Sent:

RE: [Wtr-general] Writing values to a file

2005-08-25 Thread Sean Gallagher
f = File.new("testfile.txt", "a") f.puts t1.to_s f.puts t3.to_s -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tonny Brown Sent: Thursday, August 25, 2005 5:01 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] Writing values to a file Hi there,

Re: [Wtr-general] Writing values to a file

2005-08-25 Thread Tonny Brown
Hmm almost there but I get the following error: '+': string can't be coerced into float (TypeError) it has to do with the + in f.write(t3 + "\n") __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.y

Re: [Wtr-general] Writing values to a file

2005-08-25 Thread Shao Kang Tat
Well if you create your file and open it, you can just continue writing to it no problem. It's when you create your file, close it for some reason then open it again later on that you might over write it. But in that case you just open it in append mode so nothing gets overwritten. Take a look a

Re: [Wtr-general] Writing values to a file

2005-08-25 Thread Tonny Brown
thanks. all done. though i was thinking that if i wanted to update the text file and NOT replace it, I could not use the f.write command. Is that right? i.e. if i want to keep a log of the t1 and t3 values for a period of 1 minute, getting the values every 10 seconds, the f.write command cannot b

Re: [Wtr-general] Writing values to a file

2005-08-25 Thread Shao Kang Tat
or f.write(t3.to_s + "\n") rather if t3 is the line that's giving you trouble ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Writing values to a file

2005-08-25 Thread Shao Kang Tat
try: f.write(t1.to_s + "\n") ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Writing values to a file

2005-08-25 Thread Shao Kang Tat
I believe it would be just f.write(t1 + "\n") f.write(t3 + "\n") the "\n" puts the next write on a new line ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general