Quote:
Originally Posted by zardoxnet
I am working on a metadata plugboard to be used when exporting a book and including all relevant details in the new comment field of the created book. So I have a template program and concatenate all values. The part I am looking for help with is in taking 3 values and printing them out with commas between them. Any of the 3 values might be blank, so I don't want to print a comma for those and don't want a hanging comma.
[snip]
|
Try this:
Code:
program:
ids = list_remove_duplicates($#isbn_enter & ',' & $#isbn_p_enter & ','
& $#isbn_asin, ',');
if ids then
OUTPUT6 = strcat('<tr><td>Identifier:</td><td>', ids, '</td></tr>')
else
OUTPUT6 = ''
fi
This works because list_remove_duplicates():
- removes empty items as well as duplicates.
- removes leading and trailing spaces.
- if the separator is ',' then it (like most of the list functions) rebuilds the list using ', ' (comma space).
- returns the empty string if the list is empty.