relection GetMethods() not working on user classes

Monkey Forums/Monkey Programming/relection GetMethods() not working on user classes

wiebow(Posted 2012) [#1]
Hi,

The following code does not show the method 'Help' in 'MyClass'.

Import reflection


Function Main:Int()

	Local t:= GetClasses()
	For Local i:= 0 to t.Length()-1
		
		Print("Found Class: " + t[i].Name())
		
		Local methods:= t[i].GetMethods()
		For Local i:= 0 to methods.Length()-1
			
			Print(" Has method: " + methods[i].Name())
		Next
	Next
	
	
	Return 0
	
End function


Class MyClass
	
	Method Help:Int()	
	End
End



DruggedBunny(Posted 2012) [#2]
What platform? On STDCPP, the above code shows this:

Found Class: untitled1.MyClass
 Has method: Help



wiebow(Posted 2012) [#3]
I WAS using stdcpp... Hmmmm. I'll revisit this once I get home from work, then. Thanks James.


Samah(Posted 2012) [#4]
Same for me.



DruggedBunny(Posted 2012) [#5]
Just moving thread out of Bug Reports for now...


wiebow(Posted 2012) [#6]
I can confirm that this is working for me now, without changing any code, but going to the new monkey version. I don't know why it was working for you but not for me :)