On my machine, I have no error. W2K Server SP3/IIS5, WSH 5.6.
Exact complete contents of my page from beginning to end:
<%
Class TestClass
public myVar(2)
public sub setTestClass
myVar(0) = "Hello!!"
end sub
End Class
set varObj = new TestClass
varObj.setTestClass
response.write varObj.myVar(0)
Set varObj = Nothing
%>
Ray at work
"JohnBon" <jo*******@hotmail.com> wrote in message
news:2c**************************@posting.google.c om...
Yes, that is all the code. I made this example to isolate the fault.
Line 5 is: myVar(0) = "Hello!!"
/Johnbon
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:<e#**************@TK2MSFTNGP09.phx.gbl>...
Is that all the code? That should work fine. Are you dimming myVar
elsewhere? Which line is line 5?
Ray at work
"JohnBon" <jo*******@hotmail.com> wrote in message
news:2c*************************@posting.google.co m... Hi
I have tried the following code on two differendt computers. It works
fine on one of them and on the other it's: Type mismatch: 'myVar' on
line 5
Here's the code:
Class TestClass
public myVar(2)
public sub setTestClass
myVar(0) = "Hello!!"
end sub
End Class
set varObj = new TestClass
varObj.setTestClass
response.write varObj.myVar(0)
I dont understand why?
The two computers have IIS and the following OS:
Windows 2000 Pro SP4 & Windows 2000 Server SP4
/JohnBon