> > ArraySort, like all of the array functions, can only be used
> > on one-dimensional arrays. A two-dimensional array in CF is
> > nothing more, really, than a one-dimensional array in which
> > each element is itself a one-dimensional array. You're asking
> > ArraySort to sort your outer array (PartnerArray) by the
> > elements within it, which are themselves arrays.
>
> Often you've got a 2D array like this (this might not be the
> best example ie you might say "use a structure instead" ;-), but
> it's just what comes to mind):
>
> [1] ProductID | Name | Price | Some other info..
> [2] ProductID | Name | Price | Some other info..
> [3] ProductID | Name | Price | Some other info..
> [4] ProductID | Name | Price | Some other info..
>
> and it *would* be nice to be able to sort the array by the first
> element in each element. I struggled to get it to do that for ages
> before I realised it just wasn't possible ;-)
Well, it certainly IS possible, although it's more complex than using
ArraySort. You could sort a two-dimensional array by any inner element, if
you so choose. However, you have to build that logic yourself, and it's not
going to be a speedy thing, either. You might look at a querysort custom tag
for an example.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists