Writing Strings To Text Files

new topic     » topic index » view thread      » older message » newer message

Chris Cox wrote:

>Since then, I've been looking
>for a way to write the contents of a string
>to a text file.


Jay Turley Wrote:
>printf(fn,"%s ",{s1})
>printf(fn,"%s\n",{s2})

Here is another solution:

My understanding is that puts()  is a way of putting a string to a
file...can't you just put
puts(fn,string) and have it write the entire string to that device?
I am thinking that you can...it is harder sometimes to read stuff in than to
write...

The first thing is to get the fn to write to.
That is done with Jay's line
fn = open("c:\\myfile.txt","w")

fn being the fn that puts will use... and the "w" being write to file...

Hope this helps...
Monty in Oregon.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu