核心提示:procedure FreeObjects(const strings: TStrings) ;varidx : integer;obj : TObject;beginfor idx := 0 to...
procedure FreeObjects(const strings: TStrings) ;
var
idx : integer;
obj : TObject;
begin
for idx := 0 to Pred(strings.Count) do
begin
obj := strings.Objects[idx];
FreeAndNil(obj) ;
end;
end;
用法示例:FreeObjects(ComboBox1.Items);
FreeObjects(ListBox1.Items);