Ask a Question related to Macromedia ColdFusion, Design and Development.
-
mourning2night #1
Problem combing multiple lists into one
I have three lists (m1,m2,m3) and I need to combine them into one list (m4):
<cfset m1 = valuelist(search2.cat)>
<cfset m2 = valuelist(search2.cat2)>
<cfset m3 = valuelist(search2.cat3)>
<cfset m4 = m1 & m2 & m3 >
<cfset m4 = listsort(m4,"text")>
That works fine but some of the values are mixed up.
List One = A, B, C
List Two = D, E, F
List Three = G, H,I
Combined List = A, B, CD, E, FG, H, I
The Value C get added to the next line D, and value F gets added to the next
line G.
How can I separate end values of each list?
mourning2night Guest
-
Running a query with multiple lists
Any help would be so appreciated, I have beat my head against the wall on this one and have scoured the web trying to find an answer. I am trying... -
writing content of multiple lists to db
I have a time reporting app that contains five elements, staff, date, CR (job) category (activity) and hrs. Since each staff person can work... -
'or' selection from multiple lists
Hey, I am trying to set up a selection where a user can choose from one or multiple drop downs and choose as many within a box as they want. ... -
problem with lists
I have the following code in test1.cfm with a struct that work just fine... <cfloop index="ind" from="1" to="#miQuery.recordcount#"> <tr> <cfset... -
lists, attaching behaviour dynamiclly, update lists
Hello, I am trying to get these scripts to work correctly. What I am trying to do is: 1) Look into a folder called 'tank,' then when this is... -
Kronin555 #2
Re: Problem combing multiple lists into one
What you need to do, instead of just concatenating them together, is use
ListAppend.
If you change:
<cfset m4 = m1 & m2 & m3>
to
<cfset m4 = ListAppend(m1,ListAppend(m2,m3))>
then you'll be good to go.
A list in ColdFusion is just a glorified string. m1 just contains "A,B,C", so
when you do the concatenation (&), coldfusion doesn't have any idea that you
actually want it to put a list separator in between the 2 lists ("strings")
that you are concatenating.
Kronin555 Guest



Reply With Quote

