xHarbour Reference Documentation > Class Reference (textmode) xHarbour Developers Network  

HBObject()

Abstract base class for user-defined classes.

Description

The HBObject() class serves as base class for all other built-in and user-defined classes declared with the CLASS statement. This class has no member variables but only methods required for creating instances, or objects, of a class (note: an instance is an object of a class).

All methods of HBObject() can be called in user-defined classes. They define a standard behaviour required in all classes. This standard behaviour can be changed in user-defined classes when methods of HBObject() are re-declared in a new class and re-implemented.

Note:  the most commonly re-defined method in user-defined classes is the :init() method.

Methods for object creation and initialization

:new( [<params,...>] ) --> oInstance
Creates a new instance of a class.
:init( [<params,...>] ) --> self
Initializes a new instance (object) of a class.
:initClass( [<params,...>] ) --> self
Initializes class variables of a class.

Methods for object inspection

:className() --> cClassName
Retrieves the name of the class an object belongs to.
:classSel() --> aMessages
Retrieves the messages understood by an object.
:isDerivedFrom( <oObject>|<cClassName> ) --> lIsDerived
Checks if an object belongs to or is derived from a class.
:isKindOf( <oObject>|<cClassName> ) --> lIsKindOf
Checks if an object is kind of a class.

Methods for error handling

:error() --> xReturn
Creates a runtime error.
:msgNotFound( <cMessage> ) --> xReturn
Handles unknown messages sent to an object.

Info

See also:CLASS, DATA, ERROR HANDLER, METHOD (declaration)
Category: Object functions , xHarbour extensions
Source:rtl\tobject.prg
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe