Sort Ascending by Amount size

Source: Internet
Author: User

1     vardata = JUSTEP.XBL ("Detaildata");2     //define two arrays3     varList1 =NewArray (Data.getcount ());4     varList2 =NewArray (Data.getcount ());5     //assign a value to two arrays6      for(i = 0; i < Data.getcount (); i++) {7List1[i] =Data.getid (i);8List2[i] = Data.getvalue ("Fbidprice", Data.getid (i));9 Ten     } One     //Sort: Compare the size of the amount, the big move down, after the end of the order, the amount of the largest move to the bottom; A     //Second comparison, the second largest amount moved to the penultimate, until all the comparison, is an ascending order of the amount; -      for(varj = list2.length-1; J > 0; j--) { -          for(vari = 0; I < J; i++) { the             if(List2[i] * 1 > list2[i + 1] * 1) { -                 varx =List2[i]; -List2[i] = list2[i + 1]; -List2[i + 1] =x; +  -                 vary =List1[i]; +List1[i] = list1[i + 1]; AList1[i + 1] =y; at             } -         } -     } -     //Show Rank -      for(i = 0; i < list1.length; i++) { -Data.setvalue ("franking", I + 1, List1[i]); in}

Sort Ascending by Amount size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.