function Assigned (p: Pointer): Boolean;
or
function Assigned (p: procedural_type): Boolean;
The Assigned function returns True if the pointer parameter or the address of the procedural parameter is not nil; it returns False if it is nil.
Assigned is a Borland Pascal extension.
program AssignedDemo; type PInt = ^Integer; procedure TellIfOdd (p: PInt); begin if Assigned (p) and then Odd (p^) then WriteLn ('The pointer p points to an odd value.') end; var foo: Integer; begin TellIfOdd (nil); foo := 1; TellIfOdd (@foo); foo := 2; TellIfOdd (@foo) end.