вот что получилось(реализация класса неполная):
interface
Код:
uses
News,SysUtils;
const
MaxNews = 10;
type
TStringItemList = array [1..MaxNews] of TNews;
TSection=class
public
constructor Create(_SectionName:string;_NewsName:string);
function DeleteNews(_NewsName: string): boolean;
function FindNews(_NewsName: string): string;
private
NewsList:TStringItemList;
SectionName: String;
NextSection: TSection;
Count: Integer;
end;
implementation
constructor TSection.Create;
begin
NextSection := nil;
Count := 0;
end;
function TSection.FindNews(_NewsName: string):string;
var
i:byte;
begin
for i:=1 to GetCount do
if NewsList[i].GetTitleName = _NewsName Then
begin
Result :=i;
Exit;
end;
Result := 0;
end;
function TSection.DeleteNews(_NewsName:string): boolean;
var
i: Byte;
Lst:TStringItemList;
begin
Result := False;
if count <> 0 then
begin
Lst := FindNews(_NewsName:string);
if Lst:=NewsName then
begin
for i:=Lst[index] to Count-1 do NewsList[i] := NewsList[i+1];
NewsList[Count] := nil;
Dec(Count);
Result := True;
end;
end;
end;
//если есть ошибки исправьте если несложно,заранее спасибо