No print output

Monkey Forums/Monkey Programming/No print output

Fedor(Posted 2015) [#1]
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.


Steve Ancell(Posted 2015) [#2]
You do realise that anything between #Rem and #End gets sommented out, right!?

Your Print("JA:"+info) is between that #Rem/#End block, so there's no way for it to print anything.


Steve Ancell(Posted 2015) [#3]
You may want to look into JungleIDE, it does block comments with an apostrophe on every line in the selection. I have never had any problems doing block comments the JungleIDE way.


Fedor(Posted 2015) [#4]
@Steve, that is exactly the point. The print command in the Main function should give me output no matter what. But when I uncomment just the function declaration of DumpObject but leave the code inside commented end do not call it - even the print command in Main does not work.


therevills(Posted 2015) [#5]
Works fine on v85a:



I get "Dumping bb-object" outputting...