I got tired of modifying my debug code everytime I wanted a new statistic displayed, so I made this:
global debugStatCount
function debugResetStatCount()
debugStatCount=0
debugDisplayStat("FPS",str$(screen fps()))
debugDisplayStat("Polygons",str$(STATISTIC(1)))
endfunction
function debugDisplayStat(label$,value$)
inc debugStatCount
a = 12-len(label$) : if a<1 then a=1
label$=space$(a)+label$
text 1, ((debugStatCount -1) * 15), label$ + ": "+value$
endfunction
At the top of your main loop put this:
...then anywhere in your code in any module, at any time when you want to see a variable on the screen, just add code like this:
REM For Strings
debugDisplayStat("myStringVariable",myStringVariable$)
REM For anything else
debugDisplayStat("myVariable",str$(myVariable))