Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBScript: Function returns an array

I have some VBScript code where a function returns an array.

function PreProcessFile (sFile)

    dim deData(3)

    ''populate deData with strings

    PreProcessFile = deData

End function

The code calling this function errs with a type mismatch. Any thoughts?

'' VBScript source code
Dim m_deData(3)
set m_deData = PreProcessFile("someFile.txt")
like image 841
Austin Salonen Avatar asked Mar 17 '09 16:03

Austin Salonen


1 Answers

Don't explicitly dim the size of the array outside the function and don't use set:

'' VBScript source code
Dim m_deData
m_deData = PreProcessFile("someFile.txt")
like image 177
EBGreen Avatar answered Oct 24 '22 06:10

EBGreen