FANDOM


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

?

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.