HBClass()

HBClass()

HBClass() is used in the creation of all classes

Syntax

      oClass := HBClass():New("TMyClass")

        -or-

      HBClass() is usually accessed by defining a class with the commands
      defined in hbclass.h:

        CLASS HBGetList    // Calls HBClass() to create the HBGetList class
           ...
        ENDCLASS

Returns

An instance of the HBClass Class. This special object’s :New() method can then create the classes you define.

Description

HBClass is a class that … The class methods are as follows:

New() Create a new instance of the class

Examples

      FUNCTION TestObject()
         LOCAL oObject

         oObject := HBClass():New( "TMyClass" )
         oObject:End()

         RETURN NIL

Compliance

Object Oriented syntax in Harbour is compatible with CA-Cl*pper.

However CA-Cl*pper only allowed creation of objects from a few standard classes, and did not let the programmer create new classes.

In Harbour, you can create your own classes–complete with Methods, Instance Variables, Class Variables and Inheritance. Entire applications can be designed and coded in Object Oriented style.

Platforms

All

Files

Library is core

Seealso

__objHasData(), Object Oriented Programming, CLASS

2 responses to “HBClass()

  1. Pingback: Harbour All Functions – H | Viva Clipper !

  2. Pingback: Harbour Class Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.