I have managed to add a carID to a to the first index of an array in a session. however when i try to calculate the length of the array so i know where to put the next ID i get the following error. I want to have one array with a max length of 5.
Microsoft VBScript runtime error '800a01c3'
Object not a collection
it refers to my for statement. everything works ok(i think) up to the for statement, however my array declarations may be wrong. I just can get it to work. could someone please offer dome assistance.
<%
OPTION EXPLICIT
Dim compareArray(4), carID, counter, compareArrays, counter2, compareArrays2
counter= 0
counter2 = 0
carID = REQUEST.FORM("compare")
IF SESSION("compareArray(0)")= "" THEN
compareArray(0)= carID
session("compareArray(0)") = compareArray(0)
response.write("test " & session("compareArray(0)"))
END IF
response.write("test " & session("compareArray(0)"))
FOR EACH compareArrays IN session("compareArray")
counter = counter + 1
NEXT
response.write(counter)
%>