The inherited Keyword
:?
operator:
inherited:?Method()This calls the inherited version of
Method
only if it exists. If not, it does nothing. It is equivalent to having written:
if inherited:Method exists then inherited:Method();It is quicker when an inherited version of
Method
exists, however, as lookup occurs once rather than twice.
If you are trying to determine whether a method exists, make sure to use frame
and not :Method exists
frame
(colon not period). The former uses both proto and parent inheritance (see "Combining Proto and Parent Inheritance" on page 96); the latter only uses proto inheritance..Method exists
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996