title: Add Values in an Array - Classic ASP
body: <p>I am using the following <code>For loop</code> to display all files in a folder excluding files with an <code>.asp</code> extension. </p>
  
  <p>I want to add the filename to an array, so that <code>objFileItem.Name</code> gets added to each element in <code>tmpArray</code>. </p>
  
  <p>I tried using <code>tmpArray(k) = objFileItem.Name</code> but its throwing an error.</p>
  
  <pre><code>For Each objFileItem In objFolderContents
      strFileExtension = LCase(Mid(objFileItem.Name, _
          InStrRev(objFileItem.Name, ".", -1, 1) + 1))
          If strFileExtension &lt;&gt; "asp"  Then
              strImages=strImages &amp; objFileItem.Name
          end if
  
  Next
  </code></pre>