I am setting up some code to load and save program settings I will share when it's finished.
Why can't I retrieve the correct number of dimensions of the array here?
Framework brl.reflection
Import brl.standardio
Type Thing
Field color:Int[]=[1,2,3]
EndType
Local t:Thing=New Thing
Local typeid:TTypeId=TTypeId.ForObject(t)
Local o:Object
Local otypeid:TTypeId
For Local f:TField=EachIn typeid.enumfields()
o=f.get(t)
otypeid=TTypeId.ForObject(o)
Print otypeid.ArrayDimensions(o)+" dimensions"
Select otypeid
Case IntTypeId
Print "Int"
Case ArrayTypeId
Print "Array"
Default
Print "unknown type"
EndSelect
Next
|