Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_DataListDataList Base Class

Public Function ColValsAsDelimList (
ColIndexOrName As Variant,
Optional QuoteChar As String = "",
Optional UniqueVals As Boolean = False,
Optional DelimStr As String = ","
) As String

Return the value from each row for a particular column of the datalist, as a delimited list

ColIndexOrName as Variant

The column index or name

Optional QuoteChar as String = ""

Quote (with escaping) every element of the string with this char

Optional UniqueVals as Boolean = False

If duplicate values exist, only add each value to the list once (assumes that the DataList is sorted so that duplicates are in adjacent rows)

Optional DelimStr as String = ","

The delimiter to use

Call Template:

Dim obj As New xf_DataList
Dim s As String
s = obj.ColValsAsDelimList(ColIndexOrName)
s = obj.ColValsAsDelimList(ColIndexOrName, QuoteChar, UniqueVals, DelimStr)

See Also:

Example 1:

Debug.Print lst.ColValsAsDelimList "ProductName"
-> Chai,Chang,Aniseed Syrup,Chef Anton's Cajun Seasoning,Chef Anton's Gumbo Mix,Grandma's Boysenberry Spread

Debug.Print lst.ColValsAsDelimList "ProductName", True, ";"
-> "Chai";"Chang";"Aniseed Syrup";"Chef Anton's Cajun Seasoning";"Chef Anton's Gumbo Mix";"Grandma's Boysenberry Spread"
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd