Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help with referencing number of elements from a FileListToArray

$
0
0
Having some trouble using _FileListToArray function.  

I have read the help file and I confirmed the first element [0] in the array is the number of files/folders in the array.  In my case that would be 3 files.  If I manually enter "3" in the "For $i = 2 to 3" then it works, however if I use "For $i = 2 to $aDocs[0]" or "For $i = 2 to $aDocs[0]-1" I can not get it to work.  I'm sure I am missing something simple.  I would just like to reference the number of items in the array list in my For statement.

This works...

[ autoit ]      
Local $aDocs = _FileListToArray($sPath) For $i = 2 to 3 With $oWord.Selection .EndKey(6) .InsertBreak(7) .InsertFile($sPath & $aDocs[$i]) EndWith Next

but this doesn't...

[ autoit ]      
Local $aDocs = _FileListToArray($sPath) For $i = 2 to $aDocs[0] With $oWord.Selection .EndKey(6) .InsertBreak(7) .InsertFile($sPath & $aDocs[$i]) EndWith Next

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>