Clearing Print output

Monkey Forums/Monkey Programming/Clearing Print output

Foppy(Posted 2011) [#1]
I use the Print command for debugging/testing, for example by printing the speed of a car as I accelerate in my game.

However in both Flash and HTML5, the output is quickly printed below the edge of the view, as new output is added below old output.

This made me wonder about two things:

1) It would be helpful if the output of Print was optionally printed at the top, so you would see old output disappear at the bottom of the view, though I suppose there could be technical reasons why this is not done;

2) It would be nice to have some kind of Clear command that erases all Print output, so you could have fixed output of a set of variables by doing Clear and Print every frame, without creating the scrolling list. Again there may be reasons why this does not exist (or does it?) but otherwise it would be nice.

In fact point 1 is not really necessary if 2 was possible.

Does anyone have tips on how a "Clear" command could be added, for example for HTML5?


GfK(Posted 2011) [#2]
I kind of wanted it to automatically scroll to the bottom since that's where its putting the new debug info.


therevills(Posted 2011) [#3]
@Gfk, I added this to my Monkey stuff ages ago:

http://www.monkeycoder.co.nz/Community/posts.php?topic=692#5509


GfK(Posted 2011) [#4]
Ah cool. I'd quite like Monkey to 'officially' do this (I hate re-doing this stuff every update).


therevills(Posted 2011) [#5]
Me too... but you got to do what you got to do...

It would be good if Monkey was on GitHub or something so we could "suggest" code and Mark could merge it into the official branch.

@Foppy it should be pretty easy to add a clear function, but I prefer to see all the tracing:

game_console.value = '';



Foppy(Posted 2011) [#6]
Thanks therevills, for "the codes"! :) Scrolling to the bottom is a great solution.