Jump to content

Recommended Posts

Posted

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

Posted
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 ?

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

@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"

 

"I think you are searching a bug where there is no bug... don't listen to bad advice."

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...