Quote:
Originally Posted by chaley
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 Alexand
ra and the other mail Alexand
er
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.