NULL Function

Purpose

Returns a null pointer value.

Syntax

NULL()

or

NULL

The second syntax form can be used only when the BUILTIN attribute is specified.

Description

The NULL function returns a null pointer value. The default NULL value is -1 (all 1 bits). This value is a fictitious address, which is distinct from any valid pointer address.

The -setnull compiler option allows you to designate a particular null pointer value for the NULL function at compile time. For a description of the -setnull compiler option, see your Open PL/I User's Guide.

Examples

IF LAST_POINTER = NULL() THEN CALL FINISH;

In this example, the IF statement determines whether the pointer variable LAST_POINTER is null; if so, the CALL statement executes.

Restrictions

None.