Jump to content

[Solved in 3.2.13.9] Why add ubound in _ArraySearch, now don't get 2 dimension array


Recommended Posts

Hey i have proved the new beta 3.2.13.8 and when i use _ArraySearch can't use a 2 Dimension Array, return error 2, and when i use 3.2.12.1 the function works always fine (for me) i have edit the au3 in Beta\Include Folder and set to comment the line of Ubound (the 2nd in the function) and now works in my script.

With this code the function always work with 1D array because UBound if it's a 2D returns 2.....

If UBound($avArray, 0) <> 1 Then Return SetError(2, 0, 0)

if we change the above line for this the Ubound can return 1 and 2 and the function works with 2D array

If UBound($avArray, 0) > 2 And UBound($avArray, 0) < 1 Then Return SetError(2, 0, 0)

Explain me why for this change on Beta (in Array.au3 the first line is in all the functions, none of the functions works with 2D array.....

Bug: 600 [Fixed by Gary in v.3.2.13.9]

Edited by TalivanIBM
Link to comment
Share on other sites

Hey i have proved the new beta 3.2.13.8 and when i use _ArraySearch can't use a 2 Dimension Array, return error 2, and when i use 3.2.12.1 the function works always fine (for me) i have edit the au3 in Beta\Include Folder and set to comment the line of Ubound (the 2nd in the function) and now works in my script.

With this code the function always work with 1D array because UBound if it's a 2D returns 2.....

If UBound($avArray, 0) <> 1 Then Return SetError(2, 0, 0)

if we change the above line for this the Ubound can return 1 and 2 and the function works with 2D array

If UBound($avArray, 0) > 2 And UBound($avArray, 0) < 1 Then Return SetError(2, 0, 0)

Explain me why for this change on Beta (in Array.au3 the first line is in all the functions, none of the functions works with 2D array.....

I think you are correct that the intention was to detect that the array was not more than 2 dimensions. I suggest you report this as a bug if it hasn't already been reported.

The function _ArrayMaxIndex has an second error

In the latest beta it has

If Not IsArray($avArray) Or UBound($avArray, 0) <> 1 Then Return SetError(1, 0, -1)
    If UBound($avArray, 0) <> 1 Then Return SetError(3, 0, -1)

but it should be

If Not IsArray($avArray) Then Return SetError(1, 0, -1)
    If UBound($avArray, 0) > 2 Then Return SetError(3, 0, -1)

The comments at the start shoiuld also be changed to say that they return on error if

$avArray is not a 1 or 2 dimensional array

instead of

$avArray is not a 1 dimensional array

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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