Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Class(y) - <b>class var</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CLASS VAR
 Declare class variables(s)
------------------------------------------------------------------------------

 Syntax:

    CLASS VAR <variable name list> [READONLY | RO | NOASSIGN]

 Arguments:

    <variable name list> is a list of variable names to be included
    as class variables for the current class.

 Description:

    Declares one or more class variables.  A single copy of each class
    variable is shared by its entire class.  This is in contrast to the
    situation with instance variables, where each instance of a class has
    its own copy of the instance variables of that class.

    Class variables are used to hold information that applies to an entire
    class.  Perhaps the most common example of this is the situation where a
    class variable called something like numInstances is defined, to
    keep track of the number of instances of that class in existence.  If
    numInstances were an instance variable, a separate copy of it would
    exist for each object of the class, and all these objects would have to
    be updated when a new object was created.  As a class variable,
    numInstances would only have to be set once.  Note that the
    CLASS VAR command is only valid inside a CREATE CLASS...END CLASS
    block.

    For a description of the READONLY clause, see the VAR command.

    Note that class variable names are only significant up to 9 characters,
    as opposed to Clipper's usual ten.  See the section entitled
    Length of Variable Names.

See Also: VAR Length of Variable Names

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