Quote:
Originally Posted by chaley
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...