title: How do I find the length of an associative array in AutoHotkey?
body: <p>If you use the <a href="https://autohotkey.com/docs/objects/Object.htm#Length" rel="nofollow noreferrer">length()</a> function on an <a href="https://autohotkey.com/docs/misc/Arrays.htm#Associative_Arrays_AHK_L_31+" rel="nofollow noreferrer">associative array</a>, it will return the "largest index" in use within the array. So, if you have any keys which are not integers, length() will not return the actual number of elements within your array. (And this could happen for other reasons as well.)</p>
  
  <p>Is there a more useful version of length() for finding the length of an associative array?</p>
  
  <p>Or do I need to actually cycle through and count each element? I'm not sure how I would do that without knowing all of the possible keys beforehand.</p>