When I run the code below - with some parts commented-out - it prints "Dumping bb-object":
Import reflection
#REFLECTION_FILTER="*"
Class bb
Field teller :Int = 1
Field i:String = "Bokje"
Field drijvend :Float = 0.334
End
#Rem
Function DumpObject:Void(obj:Object)
Local ci := GetClass(obj)
Local info:String = "["+ci.Name+ "]:{"
For Local f := Eachin ci.GetFields(True)
info:Float += f.Name+"=" '+f.GetValue(obj).ToString()+ ","
Next
Print ("JA:"+info)
End
#End
Function Main()
Print ("Dumping bb-object")
#Rem
Local testobj:bb = New bb
DumpObject(testobj)
#End
End
Then, when I change the commenting near the DumpObject-function like this, it doesn't say anuthing anymore:
Function DumpObject:Void(obj:Object)
#Rem
Local ci := GetClass(obj)
Local info:String = "["+ci.Name+ "]:{"
For Local f := Eachin ci.GetFields(True)
info:Float += f.Name+"=" '+f.GetValue(obj).ToString()+ ","
Next
Print ("JA:"+info)
#End
End
As you may notice, the code in the function is still commented out but even with an empty function, my output is gone.
I compile to HTML5 and work with the Linux version.
|