Hi Rich,

As it was me who built some of those macros, I feel I should reply. But I 
don't write JavaScript for a living, so I'm hoping to learn some tricks 
from others…

The easiest brute-force technique is to insert calls to JavaScript's 
"alert" function, to display the values of variables at various points. It 
takes a single parameter, which it treats as a string. You can join strings 
together with "+". For example:

alert("h=" + h + " m=" + m + " s=" + s);

After adding a line like that to a TW macro, you then need to refresh the 
page. You'll then see the "alert" popups when you open a tiddler that 
contains a call to that macro.

Another technique is to comment out the macro's return value and replace it 
with a similar debugging string:

return "h=" + h + " m=" + m + " s=" + s;

Again, you then need to refresh the page to see the new results of the 
macro calls.

Browsers have a built-in JavaScript debugger (in the F12 developer tools), 
but I've barely explored it. I'm sure other people on this group can advise 
on whether it can be used to step through TiddlyWiki JS macros. It's not 
actually clear to me how you'd locate the right place to place a breakpoint 
to do that.

– æ

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to