View Single Post
Old 10-10-2022, 10:27 AM   #420
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,495
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Code:
program:

[...]

# Returns topmost tag for all other books
	else
		re(sublist($tags, 0, 1, ','), '^(.*?)($|\..*$)', '\1')

	fi
For the 'topmost tag', what would be the best way to specifically exclude '[Cleanup]'?
First question: what is a "topmost tag"? It seems that it is the first first hierarchical component of the first tag on the list, but as you can't depend on the order of tags in the list that seems wrong.

What do you want to have happen if the first tag is '[Cleanup]'? Do you want the second tag? if so then this would work:
Code:
	t = sublist($tags, 0, 1, ',');
	if t == "[CLEANUP]" then
		t = sublist($tags, 1, 2, ',')
	fi;
	re(t, '^(.*?)($|\..*$)', '\1')
chaley is offline   Reply With Quote