Re: Splitting a list...

2009-10-10 Thread Chuka Anene
Thanks. I'm not sure if your method is quicker, but it allows me to break my list wherever I need to. cfset thelist =aa,bb,cc,dd,ee,ff,uu,vv,ww,xx,yy,zz What would be the most efficient way to split the list into two lists, Try this : cfset thelist =aa,bb,cc,dd,ee,ff,uu,vv,ww,xx,yy,zz CFSET

Re: Splitting a list...

2009-10-10 Thread Chuka Anene
cfset thelist =aa,bb,cc,dd,ee,ff,uu,vv,ww,xx,yy,zz What would be the most efficient way to split the list into two lists, Try this : cfset thelist =aa,bb,cc,dd,ee,ff,uu,vv,ww,xx,yy,zz CFSET st = REFind (([^\,]*\,){6}, thelist, 1, true) CFSET list1 = mid(theList, 1, st.len[1]-1) CFSET list2 =

Splitting a list of unknown amount

2009-10-10 Thread Chuka Anene
I've been looking for this for long now. What happens when you have a list containing coma-delimited numbers, say 1,2,3,4,X Where X is a number below 5000. How do you split this list into equal lengths of 100? ~| Want to

Re: Splitting a list of unknown amount

2009-10-10 Thread Barney Boisvert
Totally untested and written on my phone, but it should be close: A = listToArray(yourList); Parts = []; while (arrayLen(a) gt 100) { ArrayAppend(parts, a.subList(0, 100)); A = a.subList(100, arrayLen(a)); } Dump(parts); Cheers, Barneyb -- Barney Boisvert bboisv...@gmail.com

Re: Splitting a list...

2009-10-10 Thread Claude Schneegans
How do you split this list into equal lengths of 100? 1. make a function to split the list into the first 100 elements and the rest. 2. loop on the rest until its length is = 100 ~| Want to reach the ColdFusion community with