TObject
- Hierarchy
- The base class type that is ancestor to all other classes
Description
The TObject type defines the base class type. It is the oldest grandparent of all classes - every class is ultimately derived from TObject. Because of this, every object inherits the methods of TObject. The TObject methods fall into two categories - class and non-class. When prefixed by the keyword Class, a method may be called in both an object of the class, and in the class itself. Such a static method cannot access any class fields because a class has no data itself - only instantiated classes - objects - have data.
static methods |
---|
ClassName |
ClassParent |
ClassType |
Object Methods |
Create |
Free |
Destroy |
Static Methods
ClassName
Gives the class name as a string.
ClassParent
Gives the class parent name.
ClassType
Gives class type name as TClass.
Object Methods
Create
Empty object creator.
Free
Calls Destroy for a non-nil object ref.
Destroy
Releases object storage.
TObject for Delphi Web Script
In traditional Object Pascal all classes inherit from a root type called TObject. This was also the case for Delphi Web Script, from which Smart Pascal evolved. In order to better be able to import classes written in Javascript - which is extremely important with regards to having full support for the DOM (document object model) and the full spectrum of JavaScript modules - dependency on TObject as the root of all class types had to be altered. See for instance, TVariant in the example bellow: