Solved

Working With Typed Files

Posted on 2000-03-23
4
143 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now