Description
Use Assigned to determine whether the pointer or procedure referenced by P is nil. P must be a variable reference of a pointer or procedural type. [red]Assigned(P) corresponds to the test P<&gt
nil for a pointer variable, and @P <&gt
nil for a procedural variable.[/red]
Assigned returns false if P is nil, true otherwise.
Note: Assigned can't detect a dangling pointer--that is, one that isn't nil but no longer points to valid data. For example, in the code example for Assigned, Assigned won't detect the fact that P isn't valid.
楼主注意Note部分所提出的,Assigned不能发现游离指针(即它不为nil,但已经不再指向一个合法值)