I have several macros that all need access to a common function.  One
of the parameters tends to have variant data, and the common function
uses a replace routine to resolve this.

================================
 config.macros.Bbl = {
   handler: function (place, macroName, params, wikifier, paramString,
tiddler) {
     // this will run when macro is called from a tiddler
     var book = params[0];
     var strLink = book;

     if (book == 'Exo') { strLink = 'Exodus' }
     if (book == 'Gen') { strLink = 'Genesis' }
     if (book == 'Deu') { strLink = 'Deut' }
     if (book == 'Josh') { strLink = 'Joshua' }
     if (book == 'Jsh') { strLink = 'Joshua' }
     if (book == 'Jud') { strLink = 'Judges' }
     if (book == . . .
================================

Those if statements go on for a while, so I want them contained in the
common function.   I've tried to apply the evaluate parameters syntax
(pairs of curly brackets).  But I get errors such as "invalid property
id."

How do I do this?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to