AutoIt Array Error

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2010-05-17T18:31:25Z Indexed on 2010/05/17 19:50 UTC
Read the original article Hit count: 314

Filed under:
Func archiveDir($dir)

    ; Get all the files under the current dir
    $allOfDir = _FileListToArray($dir)
    Local $countDirs = 0
    Local $countFiles = 0

    $imax = UBound($allOfDir)
    For $i = 0 to $imax - 1
        If StringInStr(FileGetAttrib($allOfDir[$i]),"D") Then
            $countDirs = $countDirs + 1
        Else
            $countFiles = $countFiles + 1
        EndIf   
    Next

    Local $allDirs[$countDirs]
    Local $allFiles[$countFiles]

The error text is : "Array variable subscript badly formatted." and comes on this line:

Local $allDirs[$countDirs]

Any ideas?

© Stack Overflow or respective owner

Related posts about autoit