Ask a Question related to ASP, Design and Development.
-
JohnBon #1
Strange Array problem
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
JohnBon Guest
-
#38935 [NEW]: Strange results or object to array cast
From: marcus at synchromedia dot co dot uk Operating system: All PHP version: 5.1.6 PHP Bug Type: Class/Object related Bug... -
#24766 [Asn->Csd]: strange result array from unpack
ID: 24766 Updated by: moriyoshi@php.net Reported By: spy at spy dot zp dot ua -Status: Assigned +Status: ... -
#24766 [Ver->Asn]: strange result array from unpack
ID: 24766 Updated by: moriyoshi@php.net Reported By: spy at spy dot zp dot ua -Status: Verified +Status: ... -
#24766 [Opn->Ver]: strange result array from unpack
ID: 24766 Updated by: sniper@php.net Reported By: spy at spy dot zp dot ua -Status: Open +Status: ... -
#24766 [NEW]: strange result array from unpack
From: spy at spy dot zp dot ua Operating system: FreeBSD 4.8 PHP version: 5.0.0b1 (beta1) PHP Bug Type: Unknown/Other... -
Ray at #2
Re: Strange Array problem
Is that all the code? That should work fine. Are you dimming myVar
elsewhere? Which line is line 5?
Ray at work
"JohnBon" <johnbon78@hotmail.com> wrote in message
news:2cc41b8e.0310220423.7e5bf0c@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
Ray at Guest
-
JohnBon #3
Re: Strange Array problem
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#IzVnJmDHA.1284@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" <johnbon78@hotmail.com> wrote in message
> news:2cc41b8e.0310220423.7e5bf0c@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
> >
> >
> > /JohnBonJohnBon Guest
-
Ray at #4
Re: Strange Array problem
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" <johnbon78@hotmail.com> wrote in message
news:2cc41b8e.0310222358.7c9fb196@posting.google.c om...news:<e#IzVnJmDHA.1284@TK2MSFTNGP09.phx.gbl>...> 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> > Is that all the code? That should work fine. Are you dimming myVar
> > elsewhere? Which line is line 5?
> >
> > Ray at work
> >
> > "JohnBon" <johnbon78@hotmail.com> wrote in message
> > news:2cc41b8e.0310220423.7e5bf0c@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
Ray at Guest
-
JohnBon #5
Re: Strange Array problem
It started to work after I installed IE6 SP1. Maybe it was the WSH?
/Johnbon
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:<u0k0GZWmDHA.2436@TK2MSFTNGP09.phx.gbl>...> 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" <johnbon78@hotmail.com> wrote in message
> news:2cc41b8e.0310222358.7c9fb196@posting.google.c om...> news:<e#IzVnJmDHA.1284@TK2MSFTNGP09.phx.gbl>...> > 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> > > Is that all the code? That should work fine. Are you dimming myVar
> > > elsewhere? Which line is line 5?
> > >
> > > Ray at work
> > >
> > > "JohnBon" <johnbon78@hotmail.com> wrote in message
> > > news:2cc41b8e.0310220423.7e5bf0c@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
> > > >
> > > >
> > > > /JohnBonJohnBon Guest
-
Ray at #6
Re: Strange Array problem
Huh. Well, glad to hear it's working!
Ray at work
"JohnBon" <johnbon78@hotmail.com> wrote in message
news:2cc41b8e.0310240631.d19f791@posting.google.co m...> It started to work after I installed IE6 SP1. Maybe it was the WSH?
>
> /Johnbon
>
Ray at Guest



Reply With Quote

