[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.19 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

section 9.174 Null, section 9.172 nil, section 9.196 Pointer.



This document was generated by Frank Heckenbach on May, 10 2002 using texi2html