Re: How do I open, read and print files?

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

Dave Bunch wrote:
> 
> I can't seem to find basic examples of how one goes about opening, 
> selecting lines of text from, and then either displaying the lines 
> and/or printing them to a new file. Any suggestions about where 
> this info is found in the documentation and/or examples would be 
> greatly appreciated.
> 
> Dave

Hello Dave,
 Try
integer fn
 object line
 fn=open("myfile.txt","r")
  while 1 do
   line=gets(fn)
   if atom(line) then 
      exit 
   end if
   puts(1,line)
  end while

Don Cole }}}

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

Search



Quick Links

User menu

Not signed in.

Misc Menu