View Single Post
Old 01-01-2023, 03:14 PM   #28
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,509
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Does this produce the right answer? I added the show and ao3tags_pair variables so I could run the template.

Code:
program:
	show = $#show
#	show = 'ABC, JKL, GHI';

	show1 = '^ABC$' inlist show && '^GHI$' inlist show;
	show2 = '^DEF$' inlist show && '^GHI$' inlist show;
	show3 = '^ABC$' inlist show && '^JKL$' inlist show;
	output = '';

	ao3tags_pair = $#ao3tags_pair
#	ao3tags_pair = 'Alex / Liv, Jo / Maggy, JoJo';

	for item in ao3tags_pair:
		ni = '';
		if show1 then
			if item ==  "Alex / Liv" then
				ni = "Alexandra / Olivia"
			fi
		fi;

		if show2 then
			if item ==  "Alex / Liv" then
				ni = "Alexander / Olivia"
			fi
		fi;

		if show3 then
			if item ==  "Jo / Maggy" then
				ni = "Josefine / Maggie"
			elif item ==  "JoJo" then
				ni = "Josefine / Joe"
			fi
		fi;

		if ni then
			output = output & ',' & ni 
		else
			output = output & ',' & item
		fi
	rof;
	output = list_sort(list_remove_duplicates(output, ','), 0, ',')
chaley is offline   Reply With Quote