Thread: Columns
View Single Post
Old 08-15-2011, 04:57 PM   #19
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Noughty View Post
Like what ','), 0, ',') this part means and similar?
Those are parameters to the function identified by the ( ) pairs and are documented for each function.

The function syntax of template programs is similar to what one finds in excel and similar programs. The functions are different, but the way the functions are written and used are not. Calibre's function syntax is documented here. The functions are documented here.
Quote:
#textmult is my custom column? As I cannot find "textmult" in template guide.
'#textmult', the parameter to the field() function, is the name of my column that I used to test the template. I don't have a column named #shelf.
Quote:
At the moment I have:

{#shelf:'merge_lists(field('tags'), $, ',')'}

And in this I don't understand what $ does. Basically I would like some basics of the language, symbols and their meaning etc.
Quoting the manual
Quote:
the variable $ stands for the field the expression is operating upon, #series in this case.
In your case the $ stands for #shelf.

That template is using template program mode and consists of two functions, merge_lists() (obsolete, replaced by list_union) that uses the result (return value) of field() as its first parameter. $ is the second parameter to merge_lists, and ',' is the third parameter.
chaley is offline   Reply With Quote