Solved

Working With Typed Files

Posted on 2000-03-23
4
144 Views
Last Modified: 2010-04-04
I have created a typed file, but when I try to access the typed file to read from it I get an I/O error 103.  Can someone tell me what I'm doing wrong?
0
Comment
Question by:brettawv
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2650573
hmm,
error 103 -> File not open (guess)
did you open the file with reset or what?

meikl
0
 
LVL 6

Accepted Solution

by:
DrDelphi earned 50 total points
ID: 2650583
Error 103 is a "File not open" ... probably a matter of either forgetting to close it after the last edit or you're not opening it correctly. Try this:

Var MyFile: File of MyType
   thefilename:string;
begin
Try
 TheFilename:='My file name here';
 assignfile(MyFile,thefilename);
if FileExists(thefilename) then
 Reset(Myfile)
Else
  Rewrite(Myfile);

 /// this checks to see if the file exists and opens it accordingly, either as a new file or a file to be edited.


Finally
  Closefile(myfile);
 end;

   
 
0
 

Author Comment

by:brettawv
ID: 2650742
Thanks.
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2651472
My pleasure. <g>
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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