Skip to main content
Inspiring
December 27, 2006
Question

Need help sorting array

  • December 27, 2006
  • 5 replies
  • 490 views
#NumberFormat(variables.queue_copy[key]["od"], '__.___')# in<br>

How can I sort this listing???
    This topic has been closed for replies.

    5 replies

    Inspiring
    December 27, 2006
    > #NumberFormat(variables.queue_copy[key]["od"], '__.___')# in<br>
    > How can I sort this listing???

    Can you possibly expand on your requirement so that it's comprehensible?

    Cheers.

    --
    Adam
    Inspiring
    December 27, 2006
    Sorry I will the whole thing is a pricing wizard developed by a programmer about a year ago. I inherited the code from that person. Not sure if it is a 2d array or not. I would like the items sorted by numeric desc. I have a different language translation of the site and it uses:

    #NumberFormat(notStruct ["od"], '__.___')# in<br>

    which seems to work.
    Inspiring
    December 27, 2006
    quote:

    Originally posted by: NDWebDeveloper
    Sorry I will the whole thing is a pricing wizard developed by a programmer about a year ago. I inherited the code from that person. Not sure if it is a 2d array or not. I would like the items sorted by numeric desc. I have a different language translation of the site and it uses:

    #NumberFormat(notStruct ["od"], '__.___')# in<br>
    which seems to work.


    You have to find out. Do a text search for queue_copy in whatever you are using to edit your source code, and look for the first line where it shows up. That should give you a hint.

    By the way, if it is a 2D array, you have to know how you want it sorted. Think of it as a spreadsheet with 10 columns and 20 rows. If you were told to sort that, and were given no other information, what would you do?
    Inspiring
    December 27, 2006
    You have to start by knowing what your variables are. What is queue_copy? Is it a 2D array? If so, how exactly do you want to sort it?
    Inspiring
    December 27, 2006
    Have you tried ArraySort()? Check online documentation for the parameters.
    Inspiring
    December 27, 2006
    Sorry have very basic skills on CFML and I am trying to trouble shoot this complex pricing wizard any thoughts as to the context or code that should be placed?
    Inspiring
    December 27, 2006
    #NumberFormat(variables.queue_copy[key]["od"], '__.___')# in<br>

    How can I sort this listing???

    Not knowing what this represents, I would guess by sorting [key]. But
    what is 'key' and how is it generated. If a list, there are list sort
    functions. If a loop, what order is the loop done in.

    If you mean sort by the values of variables.queue.copy[key]["od"], then
    you are on your own, or check with cflib.org. But a basic bubble sort
    is pretty easy Computer programming 101.