Writing Strings to Text Files -Reply

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

Assuming you don't have the file:

object fn
sequence s1, s2

s1 = "Hello"
s2 = "World"

-- open file; note \\

fn = open("c:\\myfile.txt","w")
if fn = -1 then
        puts(2,"Can't open myfile.txt\n")
end if

-- output values to file

printf(fn,"%s ",{s1})
printf(fn,"%s\n",{s2})

-- close file

close(fn)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu