Sign in to follow this  
Followers 0
Teflon

Multiple Concurrent Arrays?

3 posts in this topic

Very noob question, but can AutoIt handle working with multiple arrays at the same time? For example, if I _FileListToArray, can I build another array based off of certain file attributes of subdirs from the _FileListToArray?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Name the arrays differently, and you can do whatever you want.

Somthing like

$Dir = "YourDir"
$oFS = ObjCreate("Scripting.FileSystemObject")
$aArray1 = _FileListToArray($Dir,"*",1) ; only return files

$iCounter = 1
Dim $aArray2[$iCounter]
For $i=1 To ubound($aArray1) - 1
   $oFile = $oFS.getFile($Dir & "" & $aArray1[$i])
   If $oFile.attributeyouneedtocheckagainst="BLAH" Then ; add your conditions here
      ReDim $aArray2[$iCounter]
      $aArray2[$iCounter] = $aArray1[$i]
      $iCounter = $iCounter + 1
   EndIf
Next

If you are only looking at names, then change the filter param on _FileListToArray

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

You can create multiple arrays with different names, but for this it might be better to use a two dimensional array which is basically a table. There are plenty of examples to study on this forum. You might want to start here.

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