添加 function ThwAuditCollection.NewAudit: IhwAuditItem; begin Inc(FMaxID); Result := ThwAuditItem.Create; FList.AddObject(inttostr(FMaxID),ThwAuditItem(Result)); end;查找 function ThwAuditCollection.IndentOfAudit( AIndentID: Integer): IhwAuditItem; var Index : Integer; begin Result := nil; Index := FList.Indexof(inttostr(AIndentID)); if Index < 0 then Result := nil else Result := ThwAuditItem(FList.Objects[Index]); end;前提下FList为TStringList;已经创建。其中 ThwAuditItem= class(TautoObject,ihwAuditItem);
function ThwAuditCollection.NewAudit: IhwAuditItem;
begin
Inc(FMaxID);
Result := ThwAuditItem.Create;
FList.AddObject(inttostr(FMaxID),ThwAuditItem(Result));
end;查找
function ThwAuditCollection.IndentOfAudit(
AIndentID: Integer): IhwAuditItem;
var
Index : Integer;
begin
Result := nil;
Index := FList.Indexof(inttostr(AIndentID));
if Index < 0 then
Result := nil
else
Result := ThwAuditItem(FList.Objects[Index]);
end;前提下FList为TStringList;已经创建。其中
ThwAuditItem= class(TautoObject,ihwAuditItem);
ThwAuditItem(Pointer(FList.Objects[Index]));