type
FCmp=function(const akt:TAkt;Value:String):Boolean;
function CmpName(const akt:TAkt;Value:String):Boolean;
begin
Result:=(akt^.name=Value);
end;
function CmpSurname(const akt:TAkt;Value:String):Boolean;
begin
Result:=(akt^.surname=Value);
end;
function CmpId(const akt:TAkt;Value:String):Boolean;
begin
Result:=(akt^.id=Value);
end;
function find(head:PAkt;cmp:FCmp;Value:String):PAkt;
begin
while head<>nil do
begin
if cmp(head^,Value) then
begin
Result:=head;
Exit;
end;
head:=head^.next;
end;
Result:=nil;
end;
begin
ptr:=find(head,@CmpName,'Adam');
ptr:=find(head,@CmpSurname,'Kowalski');
ptr:=find(head,@CmpId,'1234');
end.