View Single Post
Old 04-29-2020, 04:21 AM   #853
carmenchu
Groupie
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 193
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
Quote:
Originally Posted by chaley View Post
There isn't any way to do this reliably. What you are doing gets as close as one can.

I suggest you make a second column #aliases_sort, entering the value you want to see for the sort. That way it is correct. Unfortunately it means you must edit that field when you add a new book.
Well, I managed to improve the 'alias sort' column a little (program mode):
Spoiler:
Code:
program:
# prepare the name
name = field('#altname');
# John Peter Smith, MD -> MD John Smith
prepname = swap_around_comma(name);
# Smith
firstname = sublist(prepname,-1,0,' ' );
# MD John Peter
lastname = sublist(prepname,0,-1,' ' );
# Smith, MD John Peter
sortname = strcat(firstname, ', ', lastname);
# Protect single-name cases, i.e., Homerus
# As this is the last function in the program, its value will be returned.
contains(name, ' ', sortname, name);

I post it just in case someone can think of an improvement--'first name + last name' can usually be copied and pasted (i.e., from wikipedia)--the bore is to change to 'sort mode'.
I think this kind of doubled columns 'as author' can come handy also for translators, illustrators...
carmenchu is offline   Reply With Quote