Sign in to follow this  
Followers 0
blumi

Array Count

7 posts in this topic

What is the easiest way with autoit to count the values of an array?

Share this post


Link to post
Share on other sites



You mean add them together? You do that the same way you do everything with an array, a loop.

Global $aiArray[3] = [14, 13, 23]

Global $iResult
For $iX = 0 To UBound($aiArray) -1
    $iResult += $aiArray[$iX]
Next
ConsoleWrite($iResult & @CRLF)

Share this post


Link to post
Share on other sites

No not add them together.

I am sure it is so easy but I didn't found it.

Just want to know how many items the array consists of.

Global $aiArray[3] = [14, 13, 23]

I want to get 3 as result for this example array.

Share this post


Link to post
Share on other sites

Okay, that's it, thought it would be easy. ;-)

Never used this function before, just a beginner with autoit.

Thank you.

Share this post


Link to post
Share on other sites

Okay, that's it, thought it would be easy. ;-)

Never used this function before, just a beginner with autoit.

Thank you.

There's a Array tutorial in the wiki, you may want to read it :graduated:

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