Quote:
Originally Posted by capink
Code:
program:
f = field('#taglike');
icons = '';
sep = ':';
icon_expression = 'film.png=^Some Movie|Some Other Movie$,iconforseries.png=One Entry of a Game Series';
for item in icon_expression:
icon = re(item, '(.+)=(.+)', '\1');
expression = re(item, '(.+)=(.+)', '\2');
val = contains(f, expression, icon, '');
if val then
icons = list_union(icons, val, sep)
fi
rof;
ifempty(icons, 'unknown.png')
|
FWIW this is a good place to use list_split(). Without testing it, the for loop could be rewritten as
Code:
for item in icon_expression:
list_split(item, '=', 'part');
if part_1 in f then
icons = list_union(icons, part_0, sep)
fi
rof;