INIT
(Available in 00 TS Tools(Base) - TS_Tools_Root1)
Purpose
Create a 'TS_Root0' instance
Syntax
oRoot0:=TS_Root1{ [oOwner][,[#NameOfTheInstance][,[TRUE] ] ] }
Arguments
uoOwner
|
NIL, OBJECT
|
usymNameSym
|
NIL, SYMBOL
|
uloSelfDestruct
|
NIL, LOGIC, OBJECT
|
Description
This class serves no purpose on its own, the class should be used as a derived from class when defining you own application classes.
Above the properties and methods of the TS_Root0 class, this class supports the 'SelfDestructOnUnRegisterOwner' and the 'Owner' properties
Note: If the 'uloSelfDestruct' parameter is TRUE and no owner for the class is provided a error will be signaled and the object is invalidated.
Note: Passing an object as the'uloSelfDestruct' parameter is only allowed if this class is an instance of 'TS_Root2' otherwise an error will be signaled, and the object is invalidated.
Example
CLASS SomeCLass INHERIT TS_Root1
METHOD INIT( ..., ... ; ...
...) CLASS SomeCLass
// Less secure ( and simple ) form of an '[less]safe' init method
// It is better not to call any object method/access/assign from
// inside the init method, if needed do this form the 'New()' method.
// From here on insert you own initialization code
// Process the parameters
..., ...
IF lParameterError
TSTrace Warning "... parameter error ..."
SELF:InvalidateObject( )
END
// At this point all initialization code should be done
IF SELF:IsValidObject
// The 'New()' method will be called by the SUPER class
SUPER:INIT( ... ; ...
... , ... )
ELSE
TSTrace Warning TS_TEXT_GEN_CAN_NOT_INITIALIZE
SELF:InvalidateObject( )
END
RETURN SELF
METHOD INIT( ..., ..