FieldInfo.Name

Monkey Forums/Monkey Programming/FieldInfo.Name

Anatol(Posted 2012) [#1]
Hi,

I'm just testing the reflection module and when I try something like
For Local reflectionClassInfo:=EachIn reflectionClass.GetClasses()
	For Local reflectionClassFieldInfo:=EachIn reflectionClassInfo.GetFields(True)
		Print(reflectionClassFieldInfo.Name)
	Next
Next


All I get as a Print() result is:
value
value
value
value
value


Shouldn't this print the name of the fields, so e.g. "MyField" for a code like

Class MyClass
	Field MyField:String
	' ... more code here ...
End


Thanks!


Anatol(Posted 2012) [#2]
OK, I solved this. I just didn't set the REFLECTION_FILTER right

I have a project structure like
book
  book.monkey
  page.monkey
pages
  pages.monkey
  page001.monkey
  page002.monkey
  etc
touch
etc


The Page001 class in pages/page001.monkey extends the Page class in book/page.monkey, so a simple

#REFLECTION_FILTER="pages*"


didn't work. I had to add the module with the super class
#REFLECTION_FILTER="book.page|pages*"

This works fine.