procedure VerifyIDs(Var Module:TDBMSModule); var iLcv:integer; ItemP:PCoreObjectItem; coGeneric:TPersistentClass; coItem:TCoreObject; begin for iLcv:=0 to High(CoreObjectItems) do begin ItemP:=CoreObjectItems[iLcv]; coGeneric:=GetClass(ItemP^.ClassName); if (coGeneric<>nil) and coGeneric.InheritsFrom(TCoreObject) then begin coItem:=coGeneric.Create as TCoreObject; Try coItem.VerifyIDs(Module); finally FreeAndNil(coItem); end; end; end; end;
This code works as expected but why do I need to create an instance of the object if I just want to reference it's class procedure of VerifyIDs? _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal