Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>private</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
PRIVATE


Syntax:     PRIVATE <memvar list/array list>

Purpose:    To create a new instance of a memory variable or array.

Arguments:  <memvar list> is the list of memory variables or arrays
            to create.  The list can be any combination of memory
            variables and arrays.

Usage:      When a memory variable is declared PRIVATE in a procedure,
            any existing definition of the same name, whether PUBLIC or
            PRIVATE, is hidden when the current procedure terminates.
            The scope of the new variable is the current procedure and
            any lower level procedures invoked by the current
            procedure.  When the current procedure terminates, the
            variable is automatically released, and any previous
            definition becomes accessible again.

            Note that PRIVATE, unlike PUBLIC, assigns no initial value
            to the created variable.  Instead, the variable is undefined
            until a value is explicitly assigned to it.

            Arrays: In addition to declaring memory variables
            private, you can declare private arrays using the PRIVATE
            statement.  Declaring an array PRIVATE works exactly the
            same as making any other memory variable PRIVATE; PUBLIC
            arrays and private arrays created in higher-level procedures
            are hidden.  The array declaration using PRIVATE works the
            same as DECLARE with the exception that you can mix array
            and memory variable declarations.  For more information on
            arrays, see DECLARE.

            Note: The ALL, LIKE, and EXCEPT clauses are not
            supported in Clipper.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------


   The following example declares two arrays and three other variables
   PRIVATE:

   PRIVATE array1[10], array2[20], var1, var2, var3


See Also: DECLARE PARAMETERS PUBLIC

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson