GordonFreeman Posted August 17, 2012 Posted August 17, 2012 The values are: eg. 10 - 6 - 56 - 37 - 21 And i need transform the array in: 6 - 10 - 21 - 37 - 56 I try but return: 10 - 21 - 37 - 56 - 6 Note: I need the ascending. That is, 6 can not be greater than 56 Frabjous Installation
jdelaney Posted August 17, 2012 Posted August 17, 2012 It's sorting as text...first, loop through the array, and convert each element to Int(), then sort IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Danyfirex Posted August 17, 2012 Posted August 17, 2012 (edited) try this. #include <Array.au3> ;=============================================================================== ; Example 1 (using a 1D array) ;=============================================================================== Local $avArray[5] = [10,6 ,56 ,37 , 21] _ArraySort($avArray) _ArrayDisplay($avArray, "$avArray AFTER _ArraySort() ascending") Edited August 17, 2012 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
MilesAhead Posted August 17, 2012 Posted August 17, 2012 allows you to pass in any sort function. Rather like C QSort would accept a pointer to the sort function.Not only can you compare numerically if you want, your sort function can extract the sections of strings you want to compare. It's all done inline. No need to copy arrays in and out. My Freeware Page
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now