Strange Array problem

J

JohnBon

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
 
R

Ray at

Is that all the code? That should work fine. Are you dimming myVar
elsewhere? Which line is line 5?

Ray at work
 
J

JohnBon

Yes, that is all the code. I made this example to isolate the fault.

Line 5 is: myVar(0) = "Hello!!"

/Johnbon
 
R

Ray at

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,136
Messages
2,570,795
Members
47,346
Latest member
Jason Calder

Latest Threads

Top