Jump to content
Sign in to follow this  
blumi

Array Count

Recommended Posts

blumi

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

Share this post


Link to post
Share on other sites
AdmiralAlkex

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
blumi

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
blumi

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
MvGulik
Read my lips

Posted Image :graduated:


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
AdmiralAlkex

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  

×