PRIVATE |
|
|
The PRIVATE statement defines private variables in a local subroutine or in a class module.
Format
PRIVATE var {= value}, mat(rows, cols), ...
where
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 unless an initialisation value is present. If used, value must be a numeric or string constant, a CHAR() or ECHAR() function with a numeric constant argument, or a constant @-variable name. An initialisation value may be provided for a mat declaration and is equivalent to use of the MAT statement to set all elements to the given value. The initialisation is applied prior to execution of the CREATE.OBJECT subroutine, if present.
See also: Object oriented programming, CLASS, DISINHERIT, INHERIT, OBJECT(), OBJINFO(), PUBLIC, RESTRICTED, SHARED |