[thelist] [ASP] Silly behaviour with Classes

Ken Schaefer ken at adOpenStatic.com
Sat Nov 29 22:07:23 CST 2003


Is that the entire code you are running?

Cheers
Ken

Microsoft MVP - Windows Server (IIS)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Joshua Olson" <joshua at waetech.com>
Subject: [thelist] [ASP] Silly behaviour with Classes


: The following snippet is returning different values on different servers:
:
: <%
:   Class clsTest
:     Public testArr()
:
:     Public Sub Class_Initialize
:       Dim testArr(20)
:       Response.Write "TypeName within intializer: " & TypeName(testArr) &
: "<br />"
:     End Sub
:
:   End Class
:
:   Set oTest = new clsTest
:
:   Response.Write "TypeName outside intializer: " & TypeName(oTest.testArr)
&
: "<br />"
: %>
:
: Seems pretty straight forward... it simply creates a class (which
: initializes an array) and then displays the type of the variable.
:
: On one machine the output is:
:
: TypeName within intializer: Variant()
: TypeName outside intializer: Variant()
:
: On the other it's:
:
: TypeName within intializer: Variant()
: TypeName outside intializer: Empty
:
: 3 Words: "What the heck"?
:
: Any thoughts on why two machines (both running ASP/IIS/Win2k Server) would
: look at the same code and return different results?



More information about the thelist mailing list