So I'm still playing with reflection, and I've foudn out that you can't access an array's methods (Sort and Dimensions according to the docs) or its "length" field.
I know you can get the dimensions and length directly through the methods in TTypeId, but I'd like to be able to get the relevant TMethods and TField as well, for simplicity's sake.
Have a look at this:
Function test(o:Object)
Print ""
t:TTypeId=TTypeId.ForObject(o)
Print "ttypeid: "+t.name()
Print "fields:"
For f:TField=EachIn t.enumfields()
Print " "+f.name()
Next
Print "methods:"
For m:TMethod=EachIn t.enummethods()
Print " "+m.name()
Next
End Function
test(["hi"])
test "hi"
'try with TLists just to make sure it's not because String is a builtin type
test(New TList[1])
test New TList
|