Quote:
Originally Posted by chaley
Are you looking for code that tells you if both "Show A" and "Show B" are in the list, perhaps along with other values such as "Show C"? If so and if you can guarantee that there are no duplicates in the list then this works.
Code:
program:
show = list_count_matching($#show, '^(Show A|Show B)$', ',') == 2
output = '';
for item in $#pair:
if show 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, ',')
This version is more robust in the face of duplicates but is a bit slower.
Code:
program:
show = list_count(list_intersection($#show, 'Show A, Show B', ','), ',') == 2
[code as above]
|
Trying either of these 2 options actually gives me the following error:
EXCEPTION: Formatter: Expected end of program, found 'output' near Unknown on line 3