下のオブジェクトがどこにあり、それらをクリアする方法がわかりません。
例えば:
public
Alist: TStringlist;
..
procedure TForm1.FormCreate(Sender: TObject);
begin
Alist:=Tstringlist.Create;
end;
procedure TForm1. addinstringlist;
var
i: integer;
begin
for i:=0 to 100000 do
begin
Alist.add(inttostr(i), pointer(i));
end;
end;
procedure TForm1.clearlist;
begin
Alist.clear;
// inttostr(i) are cleared, right?
// Where are pointer(i)? Are they also cleared ?
// if they are not cleared, how to clear ?
end;
procedure TForm1. repeat; //newly added
var
i: integer;
begin
For i:=0 to 10000 do
begin
addinstringlist;
clearlist;
end;
end; // No problem?
私は Delphi 7 を使用しています。 Delphi 7.0 のヘルプ ファイルには、次のように書かれています。
AddObject method (TStringList)
Description
Call AddObject to add a string and its associated object to the list.
AddObject returns the index of the new string and object.
Note:
The TStringList object does not own the objects you add this way.
Objects added to the TStringList object still exist
even if the TStringList instance is destroyed.
They must be explicitly destroyed by the application.
私のプロシージャ Alist.add(inttostr(i), pointer(i)) では、オブジェクトを作成しませんでした。オブジェクトはありましたか?inttostr(i) と pointer(i) の両方をクリアするにはどうすればよいですか。
前もって感謝します