79
Var
F:Text;
grDriver: Integer;
grMode: Integer;
ErrCode: Integer;
Name:String;
Bufer:String;
IOs,i,i1,j:Integer;
Begin
textcolor(7);
Clrscr;
FillChar(Mat,SizeOf(Mat),#0);
write(“Enter File Name:”);Readln(Name);
Assign(F,Name);
Reset(F);
delete(Name,1,1);
while UpCase(Name[1]) in [“A”..’Z’] do Delete(Name,1,1);
NumFile:=copy(Name,1,Pos(“.”,Name)-1);
Readln(F,Bufer);
Val(Copy(Bufer,1,Pos(“,”,Bufer)-1),N,Ios);
Delete(Bufer,1,Pos(“,”,Bufer));
Val(Copy(Bufer,1,Pos(“,”,Bufer)-1),M,Ios);
Delete(Bufer,1,Pos(“,”,Bufer));
Val(Bufer,K,ios);
if (N<10) or (N>MaxN) or (M<10) or (MaxM<M) or (K<3) or (K>MaxK) then
Begin
write(“Данные не верны “);
Halt;
End;
for I:=1 to K do
Begin
Readln(F,Bufer);
Val(Copy(Bufer,1,Pos(“,”,Bufer)-1),L[i].N1,Ios);
Delete(Bufer,1,Pos(“,”,Bufer));
Val(Copy(Bufer,1,Pos(“:”,Bufer)-1),L[i].M1,Ios);
Delete(Bufer,1,Pos(“:”,Bufer));
Val(Copy(Bufer,1,Pos(“,”,Bufer)-1),L[i].N2,Ios);
Delete(Bufer,1,Pos(“,”,Bufer));
Val(Bufer,L[i].M2,Ios);
if (L[i].N1<0) or (L[i].N1>MaxN) or
(L[i].N2<0) or (L[i].N2>MaxN) or
(L[i].M1<0) or (L[i].M1>MaxM) or
(L[i].M2<0) or (L[i].M2>MaxM) then
Begin
write(“Данные не верны “);
Halt;
End;
End;
Readln(F,Bufer);