View Single Post
Old 07-12-2012, 06:35 AM   #6
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Rob557 View Post
The questions I was struggling with include:
i) does swap_around_comma(val) need to be enclosed in {};
Depends on whether you are using single function mode, template program mode, or general program mode. The first two require the braces. The third does not use braces.
Quote:
ii) is "val" a general parameter to be replaced by something else;
Yes, but the replacement is automatic in single function mode. "Val" is replaced with the value of the field named before the colon. In the other two modes you must explicitly provide a value. This difference is discussed in the template program mode documentation.
Quote:
iii) in bulk edit search and replace does it go in the "search for:" section;
To use template functions in bulk search/replace, you must select "template" as the source field. A box will appear for you to enter the desired template. Any of the program modes can be used, although entering general program mode templates into that box is a pain.

The search expression searches the result of evaluating the template.
Quote:
iv) is the syntax different for the bulk edit approach compared to the template syntax when setting up a user-defined custom column with column type "Column build from other columns".
No, it isn't.
Quote:
v) maybe seeing specific examples is the easiest way to see how it works?
You can see examples of using swap_around_comma in single function mode and template program mode in the thread containing this post.
chaley is offline   Reply With Quote