Quote:
Originally Posted by chaley
@capink: specifying a separator in a for statement and the function list_remove_duplicates(l, sep) are now available in master source.
|
Thanks for both. I don't seem to know how to use the new for loop. I am trying to modify your previous template to this:
Code:
program:
all_authors = category_items('authors');
res = '';
for a in '&' all_authors:
ratings = from_search('rating', strcat('rating:true and author"=', a, '"'));
if ratings then
avg = divide(mean(ratings), 2);
res = list_union(res, strcat(a, ':', avg), ',')
fi
rof;
res
Obviously I am doing something wrong (and probably silly) here.