Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Working With Typed Files

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

783 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