unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var p: PPoint; i: Integer; buf: array[0..255] of Char; type ArrPoint = array of TPoint; {用于转换的自定义类型} begin p := GetMemory(4 * SizeOf(TPoint)); for i := 0 to 3 do begin ArrPoint(p)[i].X := i; ArrPoint(p)[i].Y := i * i; end; wvsprintf(buf, '%d,%d; %d,%d; %d,%d; %d,%d', PChar(p)); ShowMessage(buf); {0,0; 1,1; 2,4; 3,9} FreeMemory(p); end; end.