I wrote a following function in vbscript.
Function GetArray()
Dim Array(2)
Array(0) = "1"
Array(1) = "2"
GetArray = Array
End Function
In the page:
<%
Dim IArray()
IArray = GetArray()
%>
But It is not work. How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Array is a reserved word in VBScript. Just use different name:
Also, don’t declare the
IArrayas dynamic array just as ordinary variant and it will get assigned the return value of the function no matter what it’s going to be: