orphan Posted October 7, 2020 Posted October 7, 2020 hi i would like use 2 versions of Array.au3 because i have a complex function who works with a version of array.au3. but in my main script when i run my main i have an obvious error like : ==> Duplicate function name. Because, when my main is in a the calling _myfunction, it dont know if we must use array.au3 function ou array3381.au3 how explain to my main.au3 to use only array3381.au3 functions in the calling of _myfunction()? the current building of my main.au3 and function.au3 is : main.au3 #include <array.au3> call_myfunction() function.au3 #include <array3381.au3> func _myfunction() ;use function in array3381.au3 endfunc
Developers Jos Posted October 7, 2020 Developers Posted October 7, 2020 That will not work, so simply fix the code that needs the old version? so, why do you need 2 versions is the real question here? 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.
orphan Posted October 7, 2020 Author Posted October 7, 2020 hi jos because _myfunction works only with array3381.au3 and i believe it is out of my skill to debug that :/
Musashi Posted October 7, 2020 Posted October 7, 2020 12 minutes ago, orphan said: it is out of my skill to debug that Could you create a shortened test script where the current version of the array.au3 causes an error ? "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
abberration Posted October 7, 2020 Posted October 7, 2020 The only reference to array3381.au3 I could find was concerning an AI bot path finding script called "A Star" (on the French AutoIt forum - I had to use Google Translate). Is this what you are working with? The A Star script was updated in 2015 to not need a modified version of array.au3. If I am completely wrong, let us know what functions you need (is it _ArrayCreate?). You can add in individual functions to your script without adding the whole array3381.au3. Try removing "#include <array3381.au3>" and let us know what errors you receive. Easy MP3 | Software Installer | Password Manager
orphan Posted October 7, 2020 Author Posted October 7, 2020 hi abberration, you are on the good way i try to use a star algo. my test works with array3381.au3 @Musashi : if you run LibChemin.au3 and switch include you can reproduce my bug. it is ok with array3381.au3 and error is coming with array.au3 sorry i can t make shortest because i dont understand all part script. but for me the problem is in _GetLowest_F_Cost_Node function LibChemin.au3 Array3381.au3
orphan Posted October 7, 2020 Author Posted October 7, 2020 @aberration : error with array.au3 is "Subscript used on non-accessible variable.:"
TheXman Posted October 7, 2020 Posted October 7, 2020 LibChemin.au3 has errors, globals that are defined as local, and other bad coding practices that could cause problems. I corrected a couple of issues in order to get it to run. Since I have no idea what the correct result should be, I will leave it to you to verify the results. I see 2 array displays when I run the script below. What happens when you run the attached version with array.au3? LibChemin_updated.au3 Musashi 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
orphan Posted October 7, 2020 Author Posted October 7, 2020 hi TheXman, i will see you correction. when you run that with array.au3. you have this error Subscript used on non-accessible variable.:"
orphan Posted October 7, 2020 Author Posted October 7, 2020 ok i checked your file. you comment line who cause the problem and it is the main function i try to debug with array.au3 to have the good result:) _FindPath call others functions like _GetLowest_F_Cost_Node. and i think the pb is in _GetLowest_F_Cost_Node who build an array who dont work with array.au3 for strange reason for me. anyway thx for help.
pixelsearch Posted October 7, 2020 Posted October 7, 2020 @orphan : I could run your original script LibChemin.au3 without errors, after doing this : * Open Array3381.au3 (same as the original version found in AutoIt 3.3.8.1, tested) * Copy the following function and paste it at the end of your script LibChemin.au3 * Also the function needs to be renamed, for instance _ArrayInsert3381() , no other change needed. Func _ArrayInsert3381(ByRef $avArray, $iElement, $vValue = "") ; <===== RENAMED function If Not IsArray($avArray) Then Return SetError(1, 0, 0) If UBound($avArray, 0) <> 1 Then Return SetError(2, 0, 0) ; Add 1 to the array Local $iUBound = UBound($avArray) + 1 ReDim $avArray[$iUBound] ; Move all entries over til the specified element For $i = $iUBound - 1 To $iElement + 1 Step -1 $avArray[$i] = $avArray[$i - 1] Next ; Add the value in the specified element $avArray[$iElement] = $vValue Return $iUBound EndFunc ;==>_ArrayInsert3381 * Change 1 line in your script, to call : _ArrayInsert3381($openlist, $i, $node) Instead of : _ArrayInsert($openlist, $i, $node) * Now you can use in your script the one and only : #include "Array.au3" Musashi 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
orphan Posted October 7, 2020 Author Posted October 7, 2020 hi pixelsearch, i did the changes, it is working . really thx, the problem was in _ArrayInsert who changed with upgrade version. ty to all for help
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