The flag is not quite as hidden as you think. 
It is actually the 'SELF" parameter. For the constructor to create a new
object it passes in a "NIL" self value, which if you think about is why a
constructor can be called as a normal method - ie all methods take the
parameter "SELF", it's just that a constructor checks this value before
executing any of "your" code.

It is interesting to note that you can call any object method with a "NIL"
object reference and no exception will occur until you attempt to reference
the object data ...

Myles.


> t1.create calls the constructor create of object t1, but does not actually
> create a new object.  In this case, the constructor is called as a normal
> method.  There is a hidden flag parameter that the compiler passes into
> the
> constructor to differentiate creating an object instance; as in:
> 
> t1 := <myclassname>.Create
> 
> The hidden flag is also used when you call the inherited constructor.
> 
> 
> Regards,
> Dennis.
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to