Quote:
Originally Posted by chaley
[/CODE]I used the keyword 'separator' to remove some ambiguity in the language parser.
|
That makes senese. It is now working for me.
Code:
program:
book_ids = from_selection('id');
all_authors = category_items('authors',book_ids);
res = '';
for a in all_authors separator '&':
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
Using all authors without restricting them using from_search() or from_selection() on large libraries is not recommended as it is verrrrrrry slow.
Quote:
Originally Posted by chaley
Note that the 'thing' following the keyword is an arbitrary expression.
|
Wow.
I will sure come up with a use for that sometime in the future.