RB2007r2, PowerBook G4 1.5ghz

I seem to be having an issue with overriding operator_convert.

Here's some code to try to explain:

I have 2 classes, one is a subclass of the other:


class SuperClass

        Sub operator_convert(s as string)
                MsgBox "SuperClass operator_convert"
        End Sub



        Sub MyMethod()
                MsgBox "SuperClass MyMethod"
        End Sub

End Class


class SubClass

        Sub operator_convert(s as string)
                MsgBox "SubClass operator_convert"
        End Sub



        Sub MyMethod()
                MsgBox "SubClass MyMethod"
        End Sub

End Class


// This code is in the App.Open event

Sub Open()

   dim myClass as SuperClass

   myClass = new SubClass       // Debugger says myClass is a SubClass

   myClass.MyMethod             // calls Subclass.MyMethod as expected

   myClass = "hello world"      // calls SuperClass.operator_convert ?!?!
                                // now Debugger says myClass is a SuperClass!

   myClass.MyMethod             // calls SuperClass.MyMethod ?!?!?!?!

End Sub




Any clues as to why this might be happening?
Is there already a bug report on it?
Any workarounds?

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to