clist - create comma-separated list

 

SYNOPSIS

<clist $values>


DESCRIPTION
The clist function returns the given list of values as one parenthetical, comma-separated value. If the list is empty, the returned value is empty too, instead of ().

This function can be used to create a Metamorph comma-separated values list. Note that a multi-value string variable is automagically turned into comma-separated values when used as an argument in a SQL command (here).


DIAGNOSTICS
clist returns the $values in one parenthetical, comma-separated value, or an empty string if there are no values.


EXAMPLE

<$list = "red" "blue" "violet">
<clist $list>
<fmt "%mIH" $ret "Roses are red.">

$ret would have the value "(red,blue,violet)" after clist is called, and the output would be "Roses are <B>red</B>.".


CAVEATS
The clist function was added Sep. 10 1996.

Note that a comma-separated list is a single set element in Metamorph. See the Metamorph documentation for details. Only parentheses are escaped in the output. Thus, if a value has a comma in it, it will be treated as multiple values in the list.


SEE ALSO
slist


Copyright © Thunderstone Software     Last updated: Sep 25 2019
Copyright © 2019 Thunderstone Software LLC. All rights reserved.