Is there a comfortable way to watch script variables while testing custom blocks

I have learned that global variables can easily been watched by using the checkbox left to the variable name in the "variables" palette. But I could'nt find anything similar for script variables. So, what did I overlook in the Reference Manual?

Hi, welcome to the forum!

Yes, you can use the untitled script pic block in your script.

On top of what Brian says, if your data isn't changing fast, then I find adding the value of the variable to a global list variable can be quite useful - effectively giving you a console type effect.

image
(the HHMMSS is just a little custom reporter to add a timestamp but you can just replace/add in name of var if monitoring a few at same time)

Or, echo the script variable to a global variable just for the purposes of debugging

image

Thank you for your help. I did already try that before, but I did not realize that the "show variable" needs a corresponding "hide variable" so that my stage was plastered with watchers within a second because each invocation of my custom block generated a new one. Now everything works fine.

You can actually just do
[scratchblocks]
hide variable [ v]
[/scratchblocks]
To hide all temporary variables.

Oh, thanks. Nice hint. Haven't tried that yet.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.