View Single Post
Old 01-01-2023, 02:07 PM   #26
ackomb
Zealot
ackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura about
 
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
Quote:
Originally Posted by chaley View Post
You are looking for the "continue" statement.

I am not sure exactly what you are trying to do but I think this might lead you to what you want. I can't guarantee that it will run in your context.
Unfortunately it's not working the way I expected / hoped.
So in this case both titles have the same tag "Alex / Liv" in one instance in combination with shows ABC & GHI and in the other ABC & JKL resulting in 2 different pairings (one with female Alexandra and the other mail Alexander

However show3 is supposed to change "Jo / Maggy" into "Josefine / Maggie" and "JoJo" into "Josefine / Joe" for the first title only.

However the way it works now is that it only hits the 1st tag under both titles and then skips the remaining.

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

	for item in $#ao3tags_pair:
		if show1 then
			if item ==  "Alex / Liv" then
				output = output & ',' & "Alexandra / Olivia"
			else
				output = output & ',' & item
			fi;
			continue
		fi;

		if show2 then
			if item ==  "Alex / Liv" then
				output = output & ',' & "Alexander / Olivia"
			else
				output = output & ',' & item
			fi;
			continue
		fi;

		if show3 then
			if item ==  "Jo / Maggy" then
				output = output & ',' & "Josefine / Maggie"
			elif item ==  "JoJo" then
				output = output & ',' & "Josefine / Joe"
			else
				output = output & ',' & item
			fi;
			continue
		fi;
		output = output & ',' & item
	rof;
	output = list_sort(list_remove_duplicates(output, ','), 0, ',')
I've attached a screenshot that hopefully shows what I'm trying to accomplish.

Ps. I've had to add/remove some semicolons here and there to make it work in the first place, just so you know. And also I could not get the previous code with the
Code:
show1 = list_count_matching($#show, '^(Show A|Show B)$', ',') == 2;
to work either but I think that's because I'm looking for an "AND - &&" and not an "OR |" but the above && seems to be working.
Attached Thumbnails
Click image for larger version

Name:	Schermafbeelding 2023-01-01 195650.jpg
Views:	78
Size:	97.8 KB
ID:	198784  
ackomb is offline   Reply With Quote