root Posted April 21, 2007 Share Posted April 21, 2007 When I try to Sort my 2-Dimension Array im getting this error, and dunno why... im not expierenced with the Array UDF so maybe someone may help with this. AutoIt Version : 3.2.2.0 Thats The Error Msg when Running the Script: \\Path\Array.au3 (582) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Local $pivot = $array[int(($left + $right)/2)] Local $pivot = ^ ERROR Global $ListArray[255][2] Func createList() Local $in, $Temp GUICtrlDelete($List1) $List1 = GuiCtrlCreateListView("1 ", 20, 30, 170, 200) $in = FileOpen(@ScriptDir & "\test.txt", 0) While 1 $Line = FileReadLine($in) If @error = -1 Then ExitLoop $Temp = StringSplit($Line, @TAB) $ListArray[$i][0] = $Temp[1] $ListArray[$i][1] = $Temp[2] $i += 1 WEnd $Size = $i _ArraySort($ListArray, 0, 0, $i) For $i = 0 To $Size Step 1 GUICtrlCreateListViewItem($ListArray[$i][0], $List1) Next FileClose($in) EndFunc Link to comment Share on other sites More sharing options...
Shevilie Posted April 21, 2007 Share Posted April 21, 2007 might be $i that is incorrect try a UBound to compare Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
root Posted April 21, 2007 Author Share Posted April 21, 2007 (edited) changed the _ArraySort to If UBound($ListArray, 1) >= $i Then _ArraySort($ListArray, 0, 0, $i) same result edit: got it, missing parameter for $i_dim Edited April 21, 2007 by root Link to comment Share on other sites More sharing options...
Sgraffite Posted April 22, 2007 Share Posted April 22, 2007 I am having this exact same problem right now. My 2d array is always [99][2] and I get the same error message when I try to run _ArraySort($aArray). I checked the array's contents and they look fine, so I don't know why this is happening. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 22, 2007 Developers Share Posted April 22, 2007 I am having this exact same problem right now. My 2d array is always [99][2] and I get the same error message when I try to run _ArraySort($aArray). I checked the array's contents and they look fine, so I don't know why this is happening.You need to specify the number of dimensions. _ArraySort( $avArray,0,0,0,2) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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