property Items[Index: Integer]: Pointer read Get write Put; default;function TList.Get(Index: Integer): Pointer; begin if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index); Result := FList^[Index];//主要是这句 end;var Temp: Pointer; begin if (Index < 0) or (Index >= FCount) then Error(@SListIndexError, Index); if Item <> FList^[Index] then begin Temp := FList^[Index]; FList^[Index] := Item;//主要是这句 if Temp <> nil then Notify(Temp, lnDeleted); if Item <> nil then Notify(Item, lnAdded); end; end;其中我写的'主要是这句'指名了,保存和取的方法
如果数据成员是一些对象如TLIST,TSTRINGLIST。
属性的读写过程应该怎么写
begin
if (Index < 0) or (Index >= FCount) then
Error(@SListIndexError, Index);
Result := FList^[Index];//主要是这句
end;var
Temp: Pointer;
begin
if (Index < 0) or (Index >= FCount) then
Error(@SListIndexError, Index);
if Item <> FList^[Index] then
begin
Temp := FList^[Index];
FList^[Index] := Item;//主要是这句
if Temp <> nil then
Notify(Temp, lnDeleted);
if Item <> nil then
Notify(Item, lnAdded);
end;
end;其中我写的'主要是这句'指名了,保存和取的方法
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
99999999999B@B@B@BBBMMMM999999999999999999999999999
999999999999M+:.:+9999M:999999999999999999999999999
9999999999999MM9+99MMM:9999999999999999999999999999
99999999999999M+.+99M:99999999999999999999999999999
99999999999999B:.++9M:99999999999999999999999999999
99999999999999B+.+99M:9999AAAAAA9999999999999999999
99999999999999B:.++9M:9AAA++++:+AAA9999999999999999
99999999999999B+.+99M:A+9+A:+++++9AA999999999999999
99999999999999B:.++9:A+@+A:,:++9+A9@M99999999999999
99999999999999B+.+9:A+A,,,,,,+A+A9@A@M9999999999999
99999999999999B:.++A+A+,,.,,+A9A9@A@M@M999999999999
99999999999999B+.+9AA+,,...,++A9@A@A@MM999999999999
99999999999999B:.+:A+++,,.,,++9@A@A@M@M999999999999
99999999999999B+.+A+@+,,,,,+9A@A+@@M@M@M99999999999
99999999999999B:.+A@+++,+,+9A9A++@M@M@MM99999999999
99999999999999B+.+A+@++++++A9A++9M@M@M@M99999999999
99999999999999B:.+A@+@+:+9A9A9A9M@M@M@9M99999999999
0A999999999999B+.+A+@+@+@+@+@A@A@9@9@9@M99999999999
99999999999999B:.+A@+@+@+@+@+@A@M@9@9@9M99999999999
99999999999999B+.+:A@+@+@+@+@A@M@9@9@9M999999999999
99999999999999B:.+:A9@+@+@+@9@A@M@9@9@M999999999999
99999999993333333333M9@9@9@9@9@M@9@9@9M999999999999
99999999993.........MAA99@9@9@M@9@9@9M9999999999999
99999999993...MMMM..MM@9@9@9@9@M@9@9M99999999999999
99999999993....MMM..M:M@9@9@9@9@9@9M999999999999999
99999999993...MMMM..M:9MMM@9@9@9MMM9999999999999999
99999999993..MMM.M..M:9999MMMMMM9999999999999999999
99999999993..MM.....M:99999999999999999999999999999
99999999993..M......M:99999999999999999999999999999
99999999993...M.....MM:9999999999999999999999999999
99999999993.........M9M:999999999999999999999999999
9999999999MMMMMMMMMMMMMM:99999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
99999999999999999999.9999999.9999999999999999999999
9999999....999999999.9999999.99999.999999..99999999
9999999.999.99999999.9999999.99999999999.9999999999
9999999.9999.99...99.9....99....99.9999.99999999999
9999999.9999.9.999.9.9.999.9.999.9.9999....99999999
9999999.9999.9.....9.9.999.9.999.9.9999.999.9999999
9999999.9999.9.99999.9.999.9.999.9.9999.999.9999999
9999999.999.99.999.9.9.999.9.999.9.9999.999.9999999
9999999....9999...99.9....99.999.9.99999...99999999
9999999999999999999999.9999999999999999999999999999
9999999999999999999999.9999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999990
你以为这样很酷吗?我只知道你很……
你以为这样很酷吗?我只知道你很……讲得好!我很害怕进他的贴子,真是活受累......
TMyRec = Record
My1:string;
My2:string;
end; TMyObj = Class(TComponent)
private
FMyRec:TMyRec;
publish
property MyRec:TMyRec read FMyRec write FMyRec
end;