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.
For example, what I have now, prints out as:
...
<tr>
<td>Identifier:</td>
<td>9781481440967 9781481440950 </td>
</tr>
... or ...
<tr>
<td>Identifier:</td>
<td>9780748120550 asin:B0065JMS64</td>
</tr>
But what I want is:
...
<tr>
<td>Identifier:</td>
<td>9781481440967, 9781481440950 </td>
</tr>
... or ...
<tr>
<td>Identifier:</td>
<td>9780748120550, asin:B0065JMS64</td>
</tr>
Here is my code from the plugboard:
isbn1 = test(field('#isbn_enter'),field('#isbn_enter'),'') ;
isbn2 = test(field('#isbn_p_enter'),field('#isbn_p_enter') ,'');
isbn3 = test(field('#isbn_asin'),strcat('asin:', field('#isbn_asin')),'');
OUTPUT6 = test(strcat(isbn1,isbn2,isbn3),strcat('<tr><td>Ide ntifier:</td><td>', isbn1,' ',isbn2,' ',isbn3,'</td></tr>'),'');
I see a function for creating a list and then printing out that list with separators. However, there are no good examples on how to use the function. Any help?
|