Delphi, virtual method interception

bearophile bearophileHUGS at lycos.com
Mon Aug 15 16:48:41 PDT 2011


In Delphi Prism there is the colon operator too:
http://prismwiki.codegear.com/en/Colon_Operator

A quote from another page:

instead of using "." to access members and get a NullReferenceException if they are nil, use ":" and the call will be skipped for nil (and the result will be nil itself). For example:

// only call dispose if the interface is implemented.
IDisposable(SomeObject):Dispose;
// access the 3rd parent of a control, where any level might be nil.
x := Button:Parent:Parent:Parent;

Bye,
bearophile


More information about the Digitalmars-d mailing list