[Gambas-user] Class.Symbols - local, inherited, overridden ???? Bah!

B Bruen bbruen at ...2308...
Wed Dec 3 02:43:48 CET 2014


I am trying to work out whether a .Symbol as returned by Class.Symbols (or more correctly Classes["someclass"].["somesymbolname"]) is local, inherited or overridden.
(Don't ask, "Why?".)

In my naive days back in Gambas 2 I had the following routine that seemed to go a far way there:
Public Sub btnCopyOwnProps_Click()

  Dim sList As New String[]
  Dim symName As String

  For Each symName In $currControl.Symbols
    If $currControl[symName].kind = Class.Property Then
      Try IsNull($currParent[symName])
      If Error Then
        sList.Add(MakeProp(symName))
      Endif
    Endif
  Next
  sList.Sort
  Clipboard.Copy(sList.Join("\n"))

End

This was, as far as I can recall, supposed to copy the names of property symbols declared in the subject $currControl class onto the clipboard that are not declared in the $currControl's parent class($currParent), i.e. they are local properties.  This still appears to work for detecting whether a property is local or inherited.  However, what is driving me mad is trying to detect whether the current class actually overrides the inherited property......

Is there any way to detect this? The IDE help browser "seems" to do so somehow, but I think it is doing it some other way.



(If you     r e a l l y     want to know why, it's for a custom control code generator.  ... ... ... I didn't think so...)

tia
Bruce

-- 
B Bruen <adamnt42 at ...626... or whatever>




More information about the User mailing list