Node:Assigned, Next:, Previous:Assign, Up:Reference



Assigned

(Under construction.)

Synopsis


function Assigned (p: Pointer): Boolean;
or
function Assigned (p: procedural_type): Boolean;

Description

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.

Conforming to

Assigned is a Borland Pascal extension.

Example


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.

See also

Null, nil, Pointer.