On Saturday, March 10, 2018 at 7:29:47 PM UTC+1, Joe Armstrong wrote:

> I have a pretty good idea how to debug almost any language by writing 
> functions calling the code
>
> and adding  print statements to the code. But I'm unclear as to how I 
> would do this in TW.
>

Well, as far as I understand, TW works on a few layers that can go wrong 
depending on what you do. There's the backend JS that is supposed to be 
hidden, there are the widgets as a functional layer with fundamental 
building blocks, the macros are merely text-substitutions not actual 
functions. But wikitext also allow for direct use of html-elements and CSS.

The browser inspector is probably the only real *tool* that you can use to 
investigate things.

I think the RSOE (Red Screen of Embarrassment) exclusively is for JS and it 
usually gives a clue to what is wrong. There are a few build in error codes 
that I believe are for wikitext - I'm primarily thinking of when a bracket 
is missing in filters.

BTW, you may find my SideEditor  <http://sideeditor.tiddlyspot.com/>of use. 
I use it all the time for testing stuff. It has similarities with the 
editor preview function.


I wanted to take a few tiddlers i don't understand and add a few print 
> statement to clarify 
>
> what is happening - is this possible?
>

... it depends ... ;-) 


If I take a maco I think what happens is that it returns some text which is 
>
> then rescanned - it would be nice to a get a trace of what get called and 
> what the
>
> return values are (same for widgets and JS code)
>

Macros are pure text substitution. I'm not sure what you mean with 
"rescanned".

You can check global variables with this syntax "$(variable)$".

If you give us your actual wikitext code it would be much easier to help 
you.

<:-)

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/44645908-152a-4d42-ae39-c35947f9d066%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to