I’m pretty new to classic asp and working with arrays is not fun 🙁
I keep getting an error on
dim isMyApiResponse
if MyAvailRooms = "Error" then
isMyApiResponse = false
else
isMyApiResponse = true
dim MyAvailArray()
If InStr( MyAvailRooms, "," ) > 1 Then
'response.write("<h2>MyAvailRooms is " & MyAvailRooms)
'response.write("<h2>var type of My avil rooms is " & VarType(MyAvailRooms))
MyAvailRooms = CStr(MyAvailRooms)
dim tempArray
tempArray = split(MyAvailRooms, ",")
dim sizeTempArray
sizeTempArray = UBound(tempArray)
response.write ("<h2>type of sizeTempArray is " &VarType(MyAvailArray))
response.write("<br/>type of temp array is " & VarType(tempArray))
reDim MyAvailArray(sizeTempArray)
MyAvailArray = tempArray
else
ReDim MyAvailArray(1)
MyAvailArray (0) = MyAvailRooms
end if
end if
I’m getting a type mismatch on the line “MyAvailArray = tempArray” above. I guess it’s a dynamic fixed array problem or something. Both types are coming back as 8204 in my reponse.write, which is variant I think.
I’m at the end of my tether, please help me Classic ASP ninjas!
While I am not able to explain why this throws an error:
You can loop through each array element and assign them one-by-one and it should work 😉