Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to a file

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Hi all,

How do i simply open a txt file 'Print' a line to it close it, then open it again and 'Print' another line after the first line?

i'm using the Print function

Thanks for any help!
 
Hi,
-----------------------------------------------------------
Dim OutFile as byte

outfile=freefile
Open "c:\temp\text.txt" for output as #outfile
print #outfile, "First line"
close #outfile

outfile=freefile
Open "c:\temp\text.txt" for append as #outfile
print #outfile, "Second line"
close #outfile
-----------------------------------------------------------

Sunaj

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top