Sign in to follow this  
Followers 0
SWINX

_ArrayMaxIndex stops counting at 21 ?

4 posts in this topic

#1 ·  Posted (edited)

The Bugs-subforum throwed an error which told me I wasn't allowed to create a new topic.

That's why its located here.

_ArrayMaxIndex gives only 21 as maximum index.

Is this a bug or a limitation?

I found out that the function _ArrayCreate also does support to 21 elements.

That is documented at the _ArrayCreate function in the Help file.

At the _ArrayMaxIndex no such thing is documented.

Also when my array has > 50 values, it keeps telling 21.

UBound returns 237 and the keys are numeric (added with _ArrayAdd)

Edited by SWINX

Share this post


Link to post
Share on other sites



Works for me.

#include <Array.au3>
;
$avArray = StringSplit("4,2,06,8,12,5",",")
For $x = 1 To 100
    _ArrayAdd($avArray, $x)
Next
;
MsgBox(0,'Max Index String value',_ArrayMaxIndex( $avArray, 0, 1))
MsgBox(0,'Max Index Numeric value',_ArrayMaxIndex( $avArray, 1, 1))
;
MsgBox(0,'Max String value',_ArrayMax( $avArray, 0, 1))
MsgBox(0,'Max Numeric value',_ArrayMax( $avArray, 1, 1))
;
MsgBox(0,'Min Index String value',_ArrayMinIndex( $avArray , 0, 1))
MsgBox(0,'Min Index Numeric value',_ArrayMinIndex( $avArray, 1, 1))
;
MsgBox(0,'Min String value',_ArrayMin( $avArray, 0, 1))
MsgBox(0,'Min Numeric value',_ArrayMin( $avArray, 1, 0))

Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Your example (from the Help file) works for me also.

But when I place that after my array, this are the results:

max index numeric value = 1

min index numeric value = 1

max index string = 21 (maybe I had this one?)

min index string = 234 (so 234 is less than 21?)

Anyway, I will use UBound now, that will also work for me.

Thanks for your reply.

Share this post


Link to post
Share on other sites

Your example (from the Help file) works for me also.

But when I place that after my array, this are the results:

max index numeric value = 1

min index numeric value = 1

max index string = 21 (maybe I had this one?)

min index string = 234 (so 234 is less than 21?)

Anyway, I will use UBound now, that will also work for me.

Thanks for your reply.

If you would post a script with your problem it would help to find what the problem is.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0