How to modify TList value?

前端 未结 4 741
醉酒成梦
醉酒成梦 2020-12-16 17:33

Delphi 2010 How to modify TList < record > value ?

type TTest = record a,b,c:Integer end;
var List:TList;
    A:TTest;
    P:Pointer;
....
..         


        
4条回答
  •  自闭症患者
    2020-12-16 17:33

    A := List[10];
    A.a := 1;
    list[10] := A;
    

    You don't have to do this with objects because they're reference types, (accessed through a pointer which the compiler manages internally to keep it out of your hair,) but records are value types so it doesn't work that way.

提交回复
热议问题