updating labels seems not to work

10 views
Skip to first unread message

Jamie Kellogg

unread,
Nov 17, 2016, 10:22:47 AM11/17/16
to Glowscript Users
Howdy, all.
I'm trying to make a simple vector components tool, but somehow updating the position, text, or visibility of a label breaks my code.  Does anyone have any ideas?  


Thanks in advance,
Jamie

Bruce Sherwood

unread,
Nov 17, 2016, 10:57:23 AM11/17/16
to Glowscript Users
resulant_label should be resultant_label (missing a t). I too had a hard time finding the error but would have found it instantly if I had turned on the browser debugger (press Ctrl-Shift-J), where you see the error

     Uncaught ReferenceError: resultant_label is not defined(…)

Unfortunately, some errors only show up in the debugger, not in the usual error reporting.

Nice program idea, by the way.

Incidentally, for objects such as arrows and labels it's unnecessary to specify "global" in a subroutine, though it doesn't hurt. It's global variables such as "drag" that need to be specified as global in a subroutine.
Reply all
Reply to author
Forward
0 new messages