Re: Simple I/O Problem

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

Thanks, it worked. Although I had to change it to printf instead of print, otherwise it printed out {100,110,1010,1013} Or something along those lines. I'll post the code to help others.

include get.e 
 
atom handle 
object line 
 
handle = open("myfile.txt","w") 
 
if handle = -1 then 
    puts(1,"Could not create file!") 
    else 
	printf(handle,"hello") 
end if 
 
close(handle) 
 
handle = open("myfile.txt","r") 
 
if handle = -1 then 
    puts(1,"Could not open file!") 
    else 
	line = gets(handle) 
	 
	puts(1,line) 
end if 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu