Quote:
Originally Posted by chaley
This is called "shortcutting".
|
Right. I knew its behavior, but can't remember whether I have heard this name before.
Quote:
Originally Posted by chaley
FWIW and perhaps doing premature optimization: this will be a bit faster because - a) local variables are faster than field lookups, and
- b) switch_if is faster than a series of ifs.
|
Good to know. I used to use local variables but was not sure whether they were to be preferred within calibre or not.
Quote:
Originally Posted by chaley
Code:
switch_if(
title_neq && authors_neq, 'true1, true2',
title_neq, 'true1',
authors_neq, 'true2',
'false')
|
The good old "WITH" statement

Yes, I was looking to something similar, but was to lazy to RTFM (I do just occasionally some small coding effort within calibre, when the need arises that is)
Well the Template Catalog Plugin seems interesting (I had indeed asked myself how to control all those templates defined at various places) but this might help a lot.
Perhaps now a description about the do's and don't's of template creation, anybody?