AutoBert Posted February 6, 2016 Share Posted February 6, 2016 (edited) This script: expandcollapse popup#include <File.au3> #include <array.au3> Global $aFile _FileReadToArray(@AppDataDir& "\2dSum.txt", $aFile) ;_ArrayDisplay($aFile) Global $a2D[$aFile[0]][2] _ArrayDelete($aFile, 0) For $i = 0 To UBound($aFile) - 1 $aSplit = StringSplit($aFile[$i], " ", 2) $a2D[$i][0] = $aSplit[0] $a2D[$i][1] = $aSplit[1] Next ;Summierung $aRes = _ArraySum2D($a2D) _ArrayDisplay($aRes, "Summen") Func _ArraySum2D(ByRef $avArray) Local $sActCol, $iActCol = -1, $sRes, $iRes Local $aTmp = _ArrayUnique($avArray) _ArrayDelete($aTmp, 0) _ArraySort($aTmp) Local $aRes[2][UBound($aTmp)] For $i = 0 To UBound($aTmp) - 1 $aRes[0][$i] = $aTmp[$i] Next For $i = 0 To UBound($avArray) - 1 For $j = 0 To UBound($aRes, 2) - 1 ConsoleWrite($avArray[$i][0] & @TAB & $avArray[$i][1] & @CRLF) If $aRes[0][$j] = $avArray[$i][0] Then $aRes[1][$j] += $avArray[$i][1] Next Next Return $aRes EndFunc ;==>_ArraySum2D crashes with: --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Program Files\AutoIt3\Include\Array.au3" (2297) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: If IsInt($aArray[$iBase]) Then If IsInt(^ ERROR ->04:19:11 AutoIt3.exe ended.rc:1 used file for testing: 2sum.txt, I am sure it worked under 3.3.6.x now i have 3.3.14.1 Edited February 6, 2016 by AutoBert Link to comment Share on other sites More sharing options...
iamtheky Posted February 6, 2016 Share Posted February 6, 2016 https://www.autoitscript.com/trac/autoit/ticket/3078 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 6, 2016 Moderators Share Posted February 6, 2016 AutoBert, To save you trouble of looking in Trac, just upgrade to 3.3.14.2. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AutoBert Posted February 6, 2016 Author Share Posted February 6, 2016 I tried to update, but download allways fails, i am mobile in Inet with speed of 64 kbits/s. After this i downloaded the zip and updated this way, but the zip seems to be 3.3.14.1: >Running:(3.3.14.1):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\Bert\AutoIt3.My\2Dsum.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Program Files\AutoIt3\Include\Array.au3" (2297) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: If IsInt($aArray[$iBase]) Then If IsInt(^ ERROR ->10:37:40 AutoIt3.exe ended.rc:1 +>10:37:40 AutoIt3Wrapper Finished. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 6, 2016 Moderators Share Posted February 6, 2016 AutoBert, To keep you going until you can download, the fix was pretty simple - just replace the relevant lines within your current _ArrayUnique function with these: ; Autocheck of first element If $iIntType = $ARRAYUNIQUE_AUTO Then Local $vFirstElem = ( ($iDims = 1) ? ($aArray[$iBase]) : ($aArray[$iColumn][$iBase]) ) If IsInt($vFirstElem) Then Switch VarGetType($vFirstElem) Case "Int32" $iIntType = $ARRAYUNIQUE_FORCE32 Case "Int64" $iIntType = $ARRAYUNIQUE_FORCE64 EndSwitch Else $iIntType = $ARRAYUNIQUE_FORCE32 EndIf EndIf ; Create error handler ObjEvent("AutoIt.Error", "__ArrayUnique_AutoErrFunc") ; Create dictionary M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AutoBert Posted February 6, 2016 Author Share Posted February 6, 2016 Thank's Melba23 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 6, 2016 Moderators Share Posted February 6, 2016 AutoBert, The least I can do seeing it was my error that caused the problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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