Moony А оно тебе надо? Если надо, то учти, что добавляются еще 2 переменные:
Код
Var
f1,f2:Text;
s1,s2:String;
i,n:Integer;
bNotified:Boolean;
ToContinue, nonStop: Boolean;
Begin
Assign(f1,'f1.Txt');Reset(f1);
Assign(f2,'f2.Txt');Reset(f2);
bNotified := False;
n := 1; ToContinue := True;
While ToContinue and (not Eof(f1)) Do
Begin
If Eof(f2) Then ToContinue := False
Else
Begin
ReadLn(f1,s1);
ReadLn(f2,s2);
If s1<>s2 Then
Begin
i := 1; nonStop := True;
While nonStop and (i <= Length(s1)) Do
Begin
If (i > Length(s2)) Or (s1[i]<>s2[i])
Then nonStop := False;
Inc(i, Byte(nonStop))
End;
WriteLn('String #',n,' Character#',i);
bNotified := True;
ToContinue := False
End;
Inc(n, Byte(ToContinue))
End;
End;
If Not bNotified Then
If Eof(f1) And Not Eof(f2) Then
WriteLn('f2 is longer than f1. f1 consists only ',n,' strings')
Else
If Eof(f2) And Not Eof(f1) Then
WriteLn('f1 is longer than f2. f2 consists only ', n ,' strings')
Else
WriteLn('Files Are Equal');
Close(f1);
Close(f2);
ReadLn
End.