Solved

Files

Posted on 2003-10-29
2
148 Views
Last Modified: 2010-04-05
how can you open a file for reading?
0
Comment
Question by:sandy22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Accepted Solution

by:
SandyXP earned 130 total points
ID: 9643606
Use the assignfile(f, 'myfile.txt'); (var f: textfile)
to open for reading: reset(f), or for clearing and then writing: rewrite(f)

to read from the file, use read(f, var1[, var2, ....]);
to write, use write(f, 'text');

finally, close the file with closefile(f)
0
 

Expert Comment

by:SandyXP
ID: 9643701
o! and you could include {$i-} IO Operation {$i+} to except the errors that may appear in an IO Operation- ex. working with files
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question