帮助上的var P: Pointer;begin P := nil; if Assigned (P) then Writeln ('You won''t see this'); GetMem(P, 1024); {P valid} FreeMem(P, 1024); {P no longer valid and still not nil} if Assigned (P) then Writeln ('You''ll see this'); end;
if Not Assigned(Form2) then Application.CreateForm(TForm2,Form2) Form2.Show ;
if Not Assigned(Form2) then Application.CreateForm(TForm2,Form2) ; Form2.Show ;
P := nil;
if Assigned (P) then Writeln ('You won''t see this');
GetMem(P, 1024); {P valid}
FreeMem(P, 1024); {P no longer valid and still not nil}
if Assigned (P) then Writeln ('You''ll see this');
end;
Form2.Show ;
Form2.Show ;