从什么开始都不重要的,这样做嘛(事实上,在D4以前没有动态数组的时候我们都这样做的)<br>TMyDataStru = record<br> ...<br>end;<br>TMyDataStrus = array [0..1] of TMyDataStru;<br>PMyDataStrus = ^TMyDataStrus;<br>...<br>procedure SetMyDataLen(var P: PMyDataStrus; Count: Integer);<br>var<br> DataSize: Integer;<br>begin<br> DataSize:= (Count + 1) * SizeOf(TMyDataStru);<br> GetMem(P, DataSize);<br> PInteger(Pointer(P))^:= Count;<br>end;<br>function SizeOfMyData(P: PMyDataStrus): Integer;<br>begin<br> Result:= PInteger(Pointer(P))^;<br>end;<br>procedure FreeMyData(var P: PMyDataStrus);<br>begin<br> FreeMem(P, (PInteger(Pointer(P))^ + 1) * SizeOf(TMyDataStru));<br> P:= nil;<br>end;