title: Sorting a 2D array in Coldfusion
body: <p>I have an array that I would like to sort according to 2 values. The first one works fine but i cant seem to get the second one right</p>
  
  <p>This is how I am sorting according to the first value:</p>
  
  <pre><code>&lt;cfloop index="outer" from="1" to="#arrayLen(result)#"&gt;
      &lt;cfloop index="inner" from="1" to="#arrayLen(result)-1#"&gt;
          &lt;cfif result[inner][7] lt result[outer][7]&gt;
              &lt;cfset arraySwap(result,inner,outer)&gt;
          &lt;/cfif&gt;
      &lt;/cfloop&gt;
  &lt;/cfloop&gt;
  </code></pre>
  
  <p>The second value that I would like to sort by is not a numeric value, it is a persons surname. It is the 2nd item in the array</p>
  
  <p>How could I go about to sort by both these values in the array, both have to be descending. I also do not want to sort by the length of the persons surname but sort them alphabetically </p>