PUBLIC

Syntax

PUBLIC name

(PUBLIC name name ...)

Explanation

PUBLIC defines its input as a local variable which is invisible in the global workspace. Unlike the LOCAL command which is specific to only one procedure, a variable defined as PUBLIC is available for all procedures called by the procedure where the variable is defined.

See also LOCAL and MAKE.

Examples

? TO PROC.A

> LOCAL "LOCAL.VAR MAKE "LOCAL.VAR "LOCAL

> PUBLIC "PUB.VAR MAKE "PUB.VAR "PUBLIC

> PR [WITHIN PROCEDURE A]

> PONS

> PROC.B

> END

PROC.A defined.

? TO PROC.B

> PR [WITHIN PROCEDURE B]

> PONS

> END

PROC.B defined.

? PROC.A

WITHIN PROCEDURE A

LOCAL.VAR is LOCAL

PUB.VAR is PUBLIC

WITHIN PROCEDURE B

PUB.VAR is PUBLIC

?