PRIVATE

From Recital Documentation Wiki
Revision as of 15:37, 3 June 2009 by Yvonnemilne (Talk | contribs)

Jump to: navigation, search

Class

Memory Variables


Purpose

Declare memory variables private to a procedure or program


Syntax

PRIVATE <memvar> | <memvar-list> |<array> | ALL [EXCEPT | LIKE <skeleton>]


See Also

DECLARE, DIMENSION, DO, DISPLAY MEMORY, LOCAL, PARAMETERS, PUBLIC, SET CLIPPER


Description

The PRIVATE command provides a facility for declaring memory variables or arrays which are local to a procedure or program. When the procedure or program returns, all of the memory variables or arrays that were declared by PRIVATE, are released. The memory variables are initially declared as logicals with the value .F., unless CLIPPER is set ON in which case they are defined as 'U'.

You can declare PRIVATE memory variables with the same name as other memory variables, which were declared at lower levels. Any procedures or programs that are called can access these private memory variables. Any memory variables or arrays that need to be accessed globally should be declared using the PUBLIC command. By default any memory variables declared at the Recital Terminal Developer development prompt, are declared as PUBLIC memory variables, and any others are declared as PRIVATE memory variables.

The ALL option allows you to define all current memory variables as private. The ALL EXCEPT <skeleton> allows the user to define all the current memory variables that do not match the wildcard <skeleton> as private. The ALL LIKE <skeleton> option allows you to define all the current memory variables that match the wildcard <skeleton> specification as private. PRIVATE ALL LIKE <skeleton> and ALL EXCEPT <skeleton> will privatize the memory variables that exist as public when used in a lower level procedure.

See DECLARE or DIMENSION for more details on array declaration.


Example

private i,j,k
? j
.F.


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer