PRIVATE

PRIVATE

Top  Previous  Next

 

The PRIVATE statement defines private variables in a local subroutine or in a class module.

 

 

Format

 

PRIVATE var, mat(rows, cols)

 

where

 

varis a simple scalar variable.

 

mat(rows, cols)is a dimensioned matrix name. The rows and cols values must be numeric constants.

 

 

The PRIVATE statement has two uses:

 

Immediately after the LOCAL statement defining a local function or subroutine. It identifies variables that have scope only within the local routine and are discarded on exit. If the routine calls itself recursively, each invocation has its own private variables. See the LOCAL statement for more details.

 

Used in a CLASS module, it defines variables that are private to the object but persist between successive executions of components of the class module. See the CLASS statement and Object Oriented Programming for more details. Private variables are initially unassigned.

 

 

See also:

Object oriented programming, CLASS, DISINHERIT, INHERIT, OBJECT(), OBJINFO(), PUBLIC, SHARED