Bob,

I have a range of methods I use to debug but they are just co-opting other 
methods I use to write the code in the first place. Eventually I would like 
to publish a debug bundle 
but for now some pointers;

   - Where possible test the code as you develop it, small ongoing tests, 
   the preview can help with this
   - Buttons can have variables displayed in their tiles (although they 
   look terrible)
   - You could have little buttons whos tooltip shows a value of something
   - I have some macros that test $:/config/debug = yes then display 
   content 
   - Popups and messages, or modals could be used to display "out of stream 
   info"
   - Many values can be global or stored externally, you can monitor this 
   outside you code
   - <$text text=<<variablename>> /> will often show you need to wikify its 
   content before further use by returning not the result but the code.



More advanced ideas

   - Using the browser inspect or debug tools can solve some problems, 
   especially CSS
   - the https://tiddlywiki.com/#transclusion%20Variable can provide 
   information in nested transclusions
      - I have a varied that can identify the tiddler in which the code is 
      defined.
   - The storyTiddler variable can be used when currentTiddler has being 
   used in a list to identify the tiddler displayed in the story list 
   (normally currentTiddler)
   - I think dump-variables in a modal may be helpful
   - Some operators allow you to test variables exist or have values

I expect i will think of more, as may others!

Tones

On Wednesday, 16 September 2020 21:28:07 UTC+10, Bob Jansen wrote:
>
> I am trying to debug some TW code that is not working as expected. The 
> code is in a macro. I have tried to display the value of a variable but 
> that does not seem possible from within a macro.
>
> Are there any debugging facilities apart from dumpvariables which gives 
> way too much for me to follow?
>
> bobj
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4c2d1851-a35b-49e6-9770-039e071b2f02o%40googlegroups.com.

Reply via email to