PeterT and I are cross posting here. But...
You can set the word counts and descriptions to whatever you want. But, I would suggest starting with the set I posted first. I did what you are doing some time ago and these are what I found to be the generally accepted counts for the different lengths. But, adding a "Long novel" or "Epic" makes sense.
Doing that would put it something like.
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');
shelf_name=cmp(words, 50000, shelf_name, 'Long', 'Long');
shelf_name=cmp(words, 75000, shelf_name, 'Epic', 'Epic');
And to explain how this works:
Code:
shelf_name=cmp(words, 1000, 'Short Story', 'Novel', 'Novel');
That says, if the number of words is less than 1000, set shelf_name to 'Short Story'. If the number of words is equal to 1000 or greater than 1000, set shelf_name to 'Novel'.
Then
Code:
shelf_name=cmp(words, 5000, shelf_name, 'Medium', 'Medium');
says, if the number of words is less than 5000, set shelf_name to whatever the variable shelf_name already is. That means use whatever it was set to in the previous line. But, if the number of words is equal to 5000 or greater than 5000, set shelf_name to 'Medium'.
The following lines repeat this pattern. The column will display the result of the last line of code.
That means I could add an extra line at the end for all the likes of Tolkein and George RR Martin:
Code:
shelf_name=cmp(words, 200000, shelf_name, 'Far to long Fantasy Novel', 'Far to long Fantasy Novel');