9.4-listing. Faylni ochish hatoligi nazorati (dastur parchasi)
var
fname : string[80]; Faylning nomi
f : TextFile; fayl
nat : integer;
faylni ochishdagi hatolik kodi - IOResult ning qiymati
answ : word; foydalanuvchining javobi
begin
fname : 'S: test.txt';
AssignFile (f, fname);
repeat
{$I-}
Reset(f); faylni o`qish uchun ochish
{$I}
Nat : IOResult;
if Nat <> 0
then answ:MessageDlg( fname' faylini ochishda hatolik bo`ldi' #13 'Yana bir marta urinib qo`raymi? ', mtWarning, [mbYes, mbNo],0);
until (Nat 0) OR (answ mrNo);
if res <> 0
then exit; Protsedura ishini yakunlash
bu yerda fayl to`g’ri ochilsa, bajarilishi kerak bo`lgan buyruqlar
Do'stlaringiz bilan baham: |