Strange Array problem

Ask a Question related to ASP, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. #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...
    2. #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: ...
    3. #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: ...
    4. #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: ...
    5. #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...
  3. #2

    Default 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

  4. #3

    Default 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
    > >
    > >
    > > /JohnBon
    JohnBon Guest

  5. #4

    Default 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...
    > 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
    > > >
    > > >
    > > > /JohnBon

    Ray at Guest

  6. #5

    Default 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...
    > > 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
    > > > >
    > > > >
    > > > > /JohnBon
    JohnBon Guest

  7. #6

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139