assigned 判断指针是否为空,空返回假
ptr:=GetMem(SizeOf(testrecord));
if not Assigned(ptr) then
begin OutputDebugString(' nil'); end;