View Single Post
Old 02-01-2011, 06:53 PM   #181
stevehaley
Junior Member
stevehaley began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
Does anyone have any idea why my custom column has broken somewhere between version 7.37 and 7.43. It was working fine but now says unknown id str_title1.
Problem appears to be in the switch statement

code as follows:-
program:
stripped=re(field('series'), '^(A|The|An)\s+', '');
shortened=shorten(stripped, 4, '-' ,4);
initials=re(stripped, '[^\w]*(\w?)[^\s]+(\s|$)', '\1');
s_index=template('{series_index:0>2.0f}');
abrv=strcat(
switch( stripped,
'.\s', initials,
'.', shortened,
field('series')),
test(s_index, strcat(' ', s_index, ': '), ''),
field('title'));

str_title1=template('{series}{series_index:0>2.0f| |: }{title}');
str_title2 = template('{#alt_series_name}{series_index:0>2.0f| |: }{title}');
str_title3 = abrv;
str_title4 = template('{series_index:0>2.0f| |: }{title}');
str_title5 = field('title');
str_default =test(field('#alt_series_name'),str_title2, str_title1);

str_input = lowercase(field('#kindle_title_fmt'));

switch(str_input,
'Series and num',str_title1,
'alt and num',str_title2,
'short and num',str_title3,
'num only',str_title4,
'no series info',str_title5,
str_default);
stevehaley is offline   Reply With Quote