Quote:
Originally Posted by ownedbycats
If it finds one unwanted identifier, it would then skip the rest.  What should I use instead of if-thens?
|
If you want all the checks to be made then you should use a sequence of if-thens without the else. You would need to pass along the intermediate result.
NB: The template in #530 doesn't have the problem. For completeness, here is the version corrected for the error you mentioned in #531.
Code:
program:
def do_one(ids, check_value, select_identifier):
si = select(ids, select_identifier);
if
!$#purchasesource==check_value && si
then
return list_difference (ids, strcat(select_identifier, si), ',')
fi;
return ids
fed;
ids = do_one($identifiers, "Amazon",'amazon');
ids = do_one(ids, "Barnes & Noble", 'barnesnoble');
ids = do_one(ids, "Kobo", 'kobo');
ids = do_one(ids, "Baen", 'baen')