View Single Post
Old 12-31-2022, 08:53 AM   #18
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
Assuming your indenting is correct then the missing 'fi' is needed to close the if/elif that begins on line 6.
Getting there it was actualy still missing a "else ni" statement for it to work.
Code:
program:
output = '';

	for item in $#pair:
		if $#show == "show A, Show B" then
			if item ==  "ABC/XYZ" then ni = "AAA / BBB"
			elif item ==  "DEF/UVW" then ni = "CCC / DDD"
			else ni = item
			fi
		else ni = item
		fi;
		output = output & ',' & ni
	rof;
	output = list_sort(list_remove_duplicates(output, ','), 0, ',')
But it only works now if it only contains show A and show B in that specific order. But as soon as there is a Show C, which is not interfering with the pairing it does not work anymore.

That means the first if statment should be something like:
Code:
if $#show contains item "show A" and "Show B" then
Of course this does not work but how would, so I tried:
Code:
if $#show != "Show A" && "Show B" then
This seems to work. Just thought I would post it for others researching something similar.

Last edited by ackomb; 12-31-2022 at 08:54 AM. Reason: small error in the code
ackomb is offline   Reply With Quote