> Hi,
> 
> I need to output the results as a comma-delimited string. An 
> example of the output from the below code would be like:
> 
> dir1 dir2 dir3 dir4 dir5
> 
> I would like to have:
> 
> dir1,dir2,dir3,dir4,dir5
> 
> Whats wrong with my below syntax?
> 
> 
> <cfdirectory action="LIST" directory="d:\books" 
> name="DirList" sort="name ASC">
> 
> <cfoutput query="DirList">
>   <cfif left(DirList.name,1) neq ".">
>     #ListGetAt(Replace(DirList.name," ",",","ALL"),1,',')#
>   </cfif>
> </cfoutput>

If the "dir1 dir2..." and so on come from the query (the one returned by
CFDIRECTORY) you can easily turn the values into a list using the
"ValueList()"
 function.  This will return a single column of data (from a query) as a
list.

Hope this helps,

Jim Davis


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to