by hmpaquito » Tue Jan 10, 2023 6:42 pm
PRIVATE
Create and initialize private memory variables and arrays
Syntax
PRIVATE <identifier> [[:= <initializer>], ... ]
Arguments
<identifier> is the name of a private variable or array to create.
If the <identifier> is followed by square brackets ([ ]), an array is
created and assigned to the <identifier>. When the <identifier>
specification indicates an array, the syntax for specifying the number
of elements for each dimension can be array[<nElements>,
<nElements2>,...] or array[<nElements>][<nElements2>]... The maximum
number of elements per dimension is 4096. The maximum number of
dimensions is limited only by available memory.
<initializer> is the optional assignment of a value to a new private
variable. An array cannot be given values with an <initializer>. An
<initializer> for a private variable consists of the inline assignment
operator (:=) followed by any valid CA-Clipper expression including a
literal array. If no explicit <initializer> is specified, the variable
is initialized to NIL. In the case of an array, each element is
initialized to NIL.
You can create and, optionally, initialize a list of variables and
arrays with one PRIVATE statement if the definitions are separated by
commas.
Description
The PRIVATE statement creates variables and arrays visible within the
current and invoked procedures or user-defined functions. This class of
variable is said to have dynamic scope. Private variables exist for the
duration of the active procedure or until explicitly released with CLEAR
ALL, CLEAR MEMORY, or RELEASE. When a private variable or array is
created, existing and visible private and public variables of the same
name are hidden until the current procedure or user-defined function
terminates.