View Single Post
Old 05-04-2014, 09:22 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I have a custom column that does a similar thing with the following code in it:
Code:
program: 
words=raw_field('#words');
shelf_name=cmp(words, 7500, 'Short Story', 'Novelette', 'Novelette');
shelf_name=cmp(words, 17500, shelf_name, 'Novella', 'Novella');
shelf_name=cmp(words, 40000, shelf_name, 'Novel', 'Novel');
The "cmp" lines compare the value of "words" with the number and return the first value if there are less words, the second if the are the same and third if there more.

You can change the word count to test against and the text to be used to match what you want. As you have four ranges, you will want to add an extra line.
davidfor is offline   Reply With Quote