Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
My program cannot read a file!!!
I would appreciate it very much if someone could help me with this one!!
I have made an application that (besides of everything else) reads
number from a file named "Rithmos". The command that reads the file
is: "Read(Rithmos,Box16);" . Τhe problem is that in the second
execution of this command the following message appears:
"Project PROJECT1.exe raised exception class EInOutError with
message "I/O error 6".Process stopped. Use Step or Run to continue."
Rithmos is defined as "Rithmos : FILE Of Word;" and Box16 is a Word-type
variable!! The file associated with Rithmos is 182KB so there is no
thought of reaching the end of file in two execution!!
What is sure is that the error is caused due to the Read command (i
have checked this out),but i cannot find a reason!!??!!
Another clue is that i have tried to read the file (with another
program that i have created) as a TFileStream , reading two bytes
a time and storing these two bytes in a Word variable and there is
no problem!! When i try to do the same (Reading the file as a
TFileStream) in my first program it fails, raising a EAccessViolation
*I am very desperated because this program belongs in the last part
of my final project in my school (which i have to present next month)
in order to get my degree!! My application is available if someone have
the time to examine it more closely (it is not very large).
0 · ·