Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Working With Typed Files

Posted on 2000-03-23
4
Medium Priority
?
163 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
[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
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 200 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

721 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