> I use Udo's ForEachTiddlerPlugin. In <<foreachtidder>-syntax double
> quotes are text string terminators. How can I mask double quotes when
> used in text string?

Because the parameters of <forEachTiddler>> are already enclosed by
double-quotes and the whole macro is, of course, surrounded by "<<"
and ">>", using those delimiters within the parameter values can be
very difficult, as you've discovered.

The usual workaround is to substitute some kind of alternative
sequence, such as a backslash-quote (\") or the equivalent hex-code
(\x22).  You can also use the single-quote to surround the parameter,
so that the double-quotes can be used within (but then you can't use
the single-quote within the parameters... it's one or the other... :-
(  In any event, this approach typically produces hard-to-read code
that is prone to typo-induced errors due to improper quoting.

Fortunately, I've come up with a completely different approach that
offers a way out...  I call them "compound macros":

Instead of wrestling with special character sequences to mimic the
embedded quotes and other delimiters, use *computed parameters* that
retrieve the needed values from separately defined, *hidden tiddler
sections* with the same tiddler to assemble and invoke the macro.
This allows you to use virtually any variety of TW syntax within the
sections (except for "!" of course, which is used to define the
section headings), including single and double quotes, TW formatting
and macros, multiple content lines with whitespace, etc.

For example, create a tiddler called [[ShowStuff]], containing:
------------------------
<<forEachTiddler
   where {{store.getTiddlerText("ShowStuff##where")}}
   sortBy {{store.getTiddlerText("ShowStuff##sortBy")}}
   script {{store.getTiddlerText("ShowStuff##script")}}
   write {{store.getTiddlerText("ShowStuff##write")}}
   begin {{store.getTiddlerText("ShowStuff##begin")}}
   end {{store.getTiddlerText("ShowStuff##end")}}
   none {{store.getTiddlerText("ShowStuff##none")}}
>>/%
!where
enter where clause here
!sortBy
enter sort expression here
!script
enter script code here
!write
enter text here
!begin
enter text here
!end
enter text here
!none
enter text here
!STOP (terminates last section)
%/
------------------------

To easily embed this compound macro in other tiddler content, simply
use:
   <<tiddler ShowStuff>>
or even
   <<tiddler ShowStuff with: foo bar baz>>
where the content in ShowStuff has embedded $1, $2 and $3 as
substitution markers where foo, bar and baz will be automatically
inserted before invoking the compound forEachTiddler macro itself.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to TiddlyWiki@googlegroups.com
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to