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>method [function]</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 METHOD [FUNCTION]
 Begin definition of a method
------------------------------------------------------------------------------

 Syntax:

    METHOD [FUNCTION] <method name> [( [<parameter list>] )]

 Arguments:

    <method name> is the name of the method being defined.  It must be
    a valid Clipper function name.

    <parameter list> is the optional list of parameters expected by the
    method.  If included, it must be surrounded by parentheses.

 Description:

    This command is used to begin the definition of a method (the actual
    code of a method).  It is usually included in the same module (.PRG
    file) as the class declaration.  Other than the addition of the METHOD
    qualifier, the syntax of this statement is the same as for a normal
    Clipper FUNCTION statement.  Like a normal function, a method defined
    with the METHOD FUNCTION command must return a value to its caller
    using the Clipper RETURN statement.

    The METHOD qualifier serves a purpose similar to Clipper's own STATIC
    qualifier for functions and procedures, in that it restricts the
    visibility of the method and prevents it from being called directly
    from external modules.  In addition, use of the METHOD qualifier ensures
    that the self variable is properly initialized.

    To declare a method which does not return a value, it is possible to
    use the METHOD PROCEDURE command.

See Also: METHOD PROCEDURE

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