Quote:
Originally Posted by rwelbourn
Thanks for the reply. I was able to get what I needed thanks to your advice but I used a dirtier method initially.
{author:contains({title}, true, false)}
With some perseverence I got to what you intended (I think):
{:'strcmp("{author}", "{title}", 'false', 'true', 'false')'}
This worked really well but tripped up if there were any " in the title - any way around this? not that it really matters - just curious.
Many thanks for your valuable guidance - didn't even know about templates - glad I do now!!
|
I have no idea why that template works. It shouldn't. Sub-templates are not (supposed to be) supported. Some day I will look at it. There are probably some bugs lurking there somewhere.
What you should use to get the author and title values is the field function. The complete template would be
Code:
{:'strcmp(field('author'), field('title'), 'false', 'true', 'false')'}
An alternate form in general program mode, slightly faster because it avoids the outermost template parsing, is
Code:
program: strcmp(field('author'), field('title'), 'false', 'true', 'false')