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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write in a textfile with writeln()

Status
Not open for further replies.

ZeeNer

Programmer
Jun 2, 2002
38
CA
i read carefully the help about write... writeln() and all the stuff to write a "text file", i need to write a text file (.txt) and make it lisible with 'enter' ... i try so many ways of write with those method (writeln) but i always get a E/S error!

If anyone know realy well how we can write a text file just write me a short exemple of how it work and i'll happy ;)
 
Check out What are text files and how can I use them?
faq218-333
in the FAQ Area of the Pascal - Forum
Steven van Els
SAvanEls@cq-link.sr
 
hi,

i think you forgot to create the file. The example you asked for:

var F: TextFile;

begin
AssignFile(F, 'NEWFILE.$$$');
Rewrite(F);
Writeln(F, 'Just created file with this text in it...');
CloseFile(F);
end;

steph [bigglasses]
 
steph thankx, it was the Rewrite(F); I think... iwas doing Reset(F)... anyway that cnnot be anything else because my file was create correctly ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top