title: VBScript not returning an array through a class
body: <p>I just inherited an old project to maintain using asp and vbs.  In vbs it passes back a single object and i need to make this into an array and everything I have tried ends up giving me a critical exception.  I have my SQL read going from a single record into an array but I can't pass it back to my main object where I need it and nobody on my project knows vbs.</p>
  
  <pre><code>Class LoadFileBS
     Public Function getDocument(req, userProfile)
        Dim dao
        Set dao = new FileDAO   'define my class
  
        Dim document
        Set document = dao.retrieve(fileId) 'this was a single return that i'm trying to make into an array
  
  If (checkAuthorization(document(1)) = true) Then 'tried making document an array and that didn't work for me.  The (1) was a test to just try and get the array working in this class and not meant as finalized code.
  </code></pre>
  
  <hr>
  
  <pre><code>Class FileDAO
     Public Function Retrieve(fileId)
         'Run the query and return the results
         Set Retrieve = runDocumentQuery(fileId)      
     End Function
  
     Private Function runDocumentQuery(fileId)
        ... 'making SQL call and it returns and i fill document with the info.
        Dim document
        Set document = new DocumentTO
        Call document.setFileId(Trim(rs.fields(SQL_FILE_ID).value))
        ...
        Set documents(UBound(documents)) = document
        rs.MoveNext
        If (NOT rs.Eof) Then
          ReDim Preserve documents(UBound(documents) + 1)
        End If
        ...  'now try and return
        If (isObject(documents(1))) Then    
          Set runDocumentQuery = documents   '&lt;-- array with multiple records
        Else
          Set runDocumentQuery = nothing
        End If
     End Function
  </code></pre>
  
  <p>Any help or tips would be appreciated.</p>
  
  <p>Thanks, 
  Josh</p>