On 23/12/2006, at 9:47 AM, Tom Benson wrote:

Woudn't you need to cast it as a MyEditField (rather than a vanilla Editfield) in order to trigger a custom method..

ie.
if app.LayoutPraticiens.Control(i) isa MyEditField then
      MyEditField(app.LayoutPraticiens.Control(i)).raz

If the method is, as seems the case here, a method of MyEditField then yes and there will be a compiler error to tell you that raz is not a method of EditField.

The other two possibilities:
1) the method is in EditField and then a polymorphic override exists with a copy in MyEditField. In that case, despatching via the parent class will be legal and the normal virtual method resolution will take place. (In C++ terms, you are casting a pointer to point to the parent class.)

2) The method 'raz' is an 'extends method' added via a module to EditField in which case it will be invoked correctly by casting as an EditField.

Andy
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to