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>create class</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CREATE CLASS
 Create a class
------------------------------------------------------------------------------

 Syntax:

    CREATE CLASS <class name> [FROM <superclass name>]

 Arguments:

    <class name> is the name of the class to be created.

    <superclass name> is the name of the class from which the new class
    should be inherited.  If omitted, the new class will have no
    superclass.

 Description:

    Creates a class.  It is the first line of a class declaration.  A class
    declaration is a sequence of Class(y) commands, beginning with
    CREATE CLASS and ending with END CLASS, which constitute the
    structure of a given class, ie. the names of all variables, messages
    and methods contained in that class.

    Class members (variables, messages and methods) declared after a
    CREATE CLASS command are considered hidden by default.  This
    means that they cannot be accessed outside the methods of their class
    (see the HIDDEN: command).  The EXPORT: and PROTECTED:
    commands can be used to achieve a visibility other than the default.

    The following commands can be used after CREATE CLASS to specify
    the structure of a class:

    .   VAR
    .   METHOD
    .   MESSAGE...METHOD
    .   CLASS VAR
    .   CLASS METHOD
    .   CLASS MESSAGE...METHOD
    .   EXPORT:
    .   PROTECTED:
    .   HIDDEN:

    These commands are collectively referred to as class declaration
    commands.  Refer to their individual entries for information.

    Once the desired class structure has been declared using these
    commands, the END CLASS command is used to end the class
    declaration.

    After the END CLASS command has appeared, the method definition
    commands METHOD FUNCTION and METHOD PROCEDURE can be used to
    define the methods which were declared in the class declaration.

 Note:

    .   Only one class should be defined per module (single .PRG file).
        This is to avoid problems in distinguishing between methods of the
        same name, such as new, which most classes implement.

    .   The CREATE CLASS command actually generates a Clipper function
        with the same name as the class.  This is explained further under
        Class Functions and Class Objects.

See Also: END CLASS Class Functions and Class Objects

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