var //增加操作 p:Pinteger; begin New(p); P^:=12; ListBox1.Items.Add('系统管理',TObject(P)); New(p); P^:=13; ListBox1.Items.Add('打印',TObject(P)); //自己写个过程 end;取整数 Num :=Pinteger(ListBox1.Objects[1])^; //释放 var i:integer begin For i:=0 to ListBox1.Items.Count-1 do begin if Assigned(ListBox1.Objects[i]) then Dispose(PInteger(ListBox1.Objects[i])); end; end;
具体的用法在delphi中有它的使用例子
p:Pinteger;
begin
New(p);
P^:=12;
ListBox1.Items.Add('系统管理',TObject(P));
New(p);
P^:=13;
ListBox1.Items.Add('打印',TObject(P)); //自己写个过程
end;取整数
Num :=Pinteger(ListBox1.Objects[1])^; //释放
var
i:integer
begin
For i:=0 to ListBox1.Items.Count-1 do
begin
if Assigned(ListBox1.Objects[i]) then
Dispose(PInteger(ListBox1.Objects[i]));
end;
end;