View Single Post
Old 10-04-2010, 08:25 AM   #30
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
Quote:
Originally Posted by chaley View Post
Using plugboards to change the Sony DB is now supported as a special format, device_db. I surely hope I didn't break anything.
I'll try that out this evening, when I'm at home.

Quote:
Originally Posted by chaley View Post
This is an interesting idea, and it screamed for simplification.
Karma is underway as this does make it a lot easier

Quote:
Originally Posted by chaley View Post
As of 0.7.22, try using the 'switch' function. Documentation is:
Code:
switch(pattern, value, pattern, value, ..., else_value) – for each pattern, value pair, checks 
if the field matches the pattern and if so, returns that value. If no pattern matches, 
then else_value is returned. You can have as many pattern, value pairs as you want.
I think that the following will do what you want.
Code:
{title:switch(^[a-dA-D],[A-D],^[e-jE-J],[E-J],^[k-qK-Q],[K_Q],^[r-zR-Z],[R-Z],[Other])}
Note that in the next release (0.7.23) you will be able to use title_sort as a field name. In .22, it always returns the empty string. Sigh.
Almost, because I want it based on {author_sort}

Code:
{author_sort:switch(^[A-D],[A - D],^[E-J],[E - J],^[K-O],[K - O],^[P-T],[P - T],^[U-Z],[U - Z],[Other])}
is a lot cleaner!
Sweetpea is offline   Reply With Quote