joiner Posted January 28, 2019 Posted January 28, 2019 AutoIT 3.3.12.0 Array.au3 - original how is that?
joiner Posted January 28, 2019 Author Posted January 28, 2019 this is a project. over 3000 lines of main code the error is not in my code, but in the library what reasons can be?
Subz Posted January 28, 2019 Posted January 28, 2019 What version do you have as that appears on line 111 whereas v 3.3.14.5 it appears on line 156? When I said post your code, I mean post what your $vValue is as it's obviously an issue with splitting the $vValue.
joiner Posted January 28, 2019 Author Posted January 28, 2019 3.3.12.0 use Local $aArray[0][2] _ArrayAdd($aArray, $i & '|' & _ArrayToString($aArray_1, '<>')) user of my program sent this error. I can not repeat the error other users don't have this error windows 10 Array.au3
Developers Jos Posted January 28, 2019 Developers Posted January 28, 2019 1 hour ago, joiner said: user of my program sent this error. I can not repeat the error Well, You need to provide a reproducer of the issue when you want any proper help as the provided information is not much to go on. Likely this line returns something the func can't cope with: _ArrayToString($aArray_1, '<>') Jos 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.
TheDcoder Posted January 28, 2019 Posted January 28, 2019 2 hours ago, joiner said: the error is not in my code, but in the library Nope, not true. The error indicates that your array is out of bounds, i.e either the element index is out of the defined range or the variable itself is not an array. Nothing to do with the library. I suggest you thorougly sanitize any input from the user and see if that error still happens EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
joiner Posted January 28, 2019 Author Posted January 28, 2019 sorry, it was not exactly expressed if the data is incorrect, the function(_ArrayAdd) should return an error ;~ array.au3 If Not IsArray($avArray) Then Return SetError(1, 0, -1) $vValue - always string when I am mistaken, it points to my line, but not to a line in udf Thanks for the discussion. I will think
Developers Jos Posted January 28, 2019 Developers Posted January 28, 2019 Agree we need to catch as many errors where possible but we also expect the coder to be due diligent in checking data thrown at the functions. Just show us a scriptlet that replicates the issue so we can determine whether the UDF needs changes or not. Jos 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.
joiner Posted January 28, 2019 Author Posted January 28, 2019 (edited) Local $sortmod[0][2], $sortdis[0][2], $sortothers[0][2], $picdis[0][2] Local $ksgtc = $objc.Keys() For $i = 0 To UBound($ksgtc) - 1 $gtitm = $objc.Item($ksgtc[$i]);always array If $gtitm[0] == 'mod' Then ;~ _GETCHNIT($sortmod, $ksgtc[$i], $i) Else If $gtitm[9] = 128 Then If $gtitm[0] == 'pic' Or $gtitm[0] == 'ico' Then _ArrayAdd($picdis, $i & '|' & _ArrayToString($gtitm, '<>')) Else _ArrayAdd($sortdis, $i & '|' & _ArrayToString($gtitm, '<>')) EndIf Else _ArrayAdd($sortothers, $i & '|' & _ArrayToString($gtitm, '<>')) EndIf EndIf Next this is the part of the code that causes the error Jos, thank Edited January 28, 2019 by joiner
Developers Jos Posted January 28, 2019 Developers Posted January 28, 2019 .. but that is not a runnable code so doesn't replicate the issue, so doesn't help anybody to determine what the actual issue is. Jos 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.
joiner Posted January 28, 2019 Author Posted January 28, 2019 This is an example of the formation of arrays. I will not pester you with questions. Waiting for updates from the user of my program
Nine Posted January 28, 2019 Posted January 28, 2019 or you could simply insert a few _arraydisplay before you run _arrayadd and show us the contents of the various arrays you are using... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
iamtheky Posted January 28, 2019 Posted January 28, 2019 (edited) 2 hours ago, joiner said: This is an example of the formation of arrays No, its not. It is an example of you hoping arrays are formed and then attempting to slam whatever result comes back into an existing array (with qualifications that the returned data may not even meet...). We will require real data and runnable scripts or this is going to be tedious. Here is an example of the $picdis branch working, you could craft an example that doesnt work in the same manner if your concern is accurate. ;picdis example #include<array.au3> Local $sortmod[0][2], $sortdis[0][2], $sortothers[0][2], $picdis[0][2] ;~ Local $ksgtc = $objc.Keys() For $i = 0 To 0 local $gtitm[10]= ['ico',1,2,3,4,5,6,7,8,128];$gtitm = $objc.Item($ksgtc[$i]);always array _ArrayDisplay($gtitm) If $gtitm[0] == 'mod' Then ;~ _GETCHNIT($sortmod, $ksgtc[$i], $i) Else If $gtitm[9] = 128 Then If $gtitm[0] == 'pic' Or $gtitm[0] == 'ico' Then _ArrayAdd($picdis, $i & '|' & _ArrayToString($gtitm, '<>')) Else _ArrayAdd($sortdis, $i & '|' & _ArrayToString($gtitm, '<>')) EndIf Else _ArrayAdd($sortothers, $i & '|' & _ArrayToString($gtitm, '<>')) EndIf EndIf _ArrayDisplay($picdis) Next Edited January 28, 2019 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
joiner Posted January 28, 2019 Author Posted January 28, 2019 (edited) ver. AutoIt 3.3.12.0 #include <Array.au3> Local $aArray_1[1] Local $aArray[0][2] $aArray_1[0] = 'string' & @CRLF & 'string' _ArrayAdd($aArray, 'string' & '|' & _ArrayToString($aArray_1, '<>')) There is no error in version 3.3.14.5 I apologize, the theme for the old version AutoIT Edited January 28, 2019 by joiner
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