| | |
runtime error as IOresult<>0
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2009
Posts: 5
Reputation:
Solved Threads: 0
ok, when the user types in a non-exist file name, the program simply shut down. i dont know what happen
this proceure is called in the main program ,yet, runtime error occurs and the screen just flashes out. it works perfectly when i type in the correct filename. i need your help!!!
grace
procedure set_up;
begin
write('file');readln(file);
assign(f,file); reset(f);
{$I-}if IOresult<>0 then writeln('NO File....');
close(f);{$I+}
end;
....
{this is the main program}
begin
setup;
endthis proceure is called in the main program ,yet, runtime error occurs and the screen just flashes out. it works perfectly when i type in the correct filename. i need your help!!!
grace
0
#3 Nov 8th, 2009
catch the reset(filevar)
pascal Syntax (Toggle Plain Text)
{$I-} reset(f); {$I+} if ioresult <> 0 then writeln('error when trying to open the file');
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
![]() |
Similar Threads
- Runtime Error -21470024770 (8007007e) (Windows NT / 2000 / XP)
- Runtime Error 226 (Windows 95 / 98 / Me)
- runtime error#58 (Visual Basic 4 / 5 / 6)
- "The Sims" visual C++ runtime error, what shall i do? (Windows Software)
- Visual Runtime Error, Sound Problem, Disabled Norton and more! (Windows NT / 2000 / XP)
- Runtime Error 424 object required (was: Please Help!) (Visual Basic 4 / 5 / 6)
- Runtime error using Incredimail on XP (Windows NT / 2000 / XP)
- Runtime error ??!! (Windows 95 / 98 / Me)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Haw to allow to enter number only from number 1 to 65535.
- Next Thread: KeyPress, KeyDown not triggering event
| Thread Tools | Search this Thread |
Tag cloud for Pascal and Delphi





