unit Un_class;

interface

type TAbonent=class
              FFIO:string[30];
              FAdress:record
                     street:string[20];
                     num_home:integer;
                     num_flat:integer
                     end;
              Fnumberphone:string[11];
              constructor Create (var t:TextFile);
              procedure Print;
              function Less_and_equiv(obj:TAbonent):boolean;//(Fnumberphone<=obj)
              function Compare(obj:tAbonent;s:string):Boolean;
              function Compare1(obj:tAbonent;q:string):Boolean;
              function Stop(obj:tAbonent;s:string):Boolean;
              end;

implementation

constructor TAbonent.Create;
begin
  inherited Create; // объем памяти
  Readln(t,FFio);
  Readln(t,FAdress.street);
  Readln(t,FAdress.num_home);
  Readln(t,FAdress.num_flat);
  Readln(t,Fnumberphone);
  if not Eof(t) then Readln(t)//пропуск пустой строки
end;

procedure TAbonent.Print;
begin
  Writeln('ФИО=',FFIO);
  Writeln('Адрес=',' ул.',FAdress.street,' д.',FAdress.num_home,' кв.',FAdress.num_flat);
  Writeln('Номер телефона=',Fnumberphone);
  Writeln('-------------------');
end;

function TAbonent.Less_and_equiv;
begin
  result:=Fnumberphone<=obj.Fnumberphone
end;

function TAbonent.Compare;
begin
  result:=copy(obj.Fnumberphone,2,3)=s
end;

function TAbonent.Compare1;
begin
   result:=obj.Fadress.street=q;
end;

function TAbonent.stop;
begin
  stop:=False;
  if copy(obj.Fnumberphone,2,3)>s then stop:=True;
end;

end.

