473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with Class Level Properties

One of our servers fried here a couple of weeks back, so we temporarily
switched to run IIS on another server. Well, when the new server replacement
got set up, I started having problems with what I thought was a fairly simple
ASP feature.

<%
Class clsHREF
Dim child(10)
Sub init()
Dim i
For i = LBound(child) To UBound(child)
child(i) = ""
Next
End Sub
End Class

Dim objHREF
Set objHREF = new clsHREF
Call objHREF.init()
Response.Write(objHREF.child(1))
%>

The problem here is that the class level variables that are dimensioned as
arrays are not accessible in the class methods. Not sure why the server does
not recognize this construct, but it gives the following script error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'LBound'
test.asp, line 7

All that really means is that the child attribute is not recognized (especially
not as an array that has a Lower Bound). Are there any configuration issues on
IIS that might cause it to have grief along these lines? The non-class
features seem to work ok, and I'm connecting with the DB fine, but I can't grok
why this would run afoul.

Thanks,
Chris Rathman
Jul 19 '05 #1
4 1275
ChrisRath wrote:
One of our servers fried here a couple of weeks back, so we
temporarily switched to run IIS on another server. Well, when the
new server replacement got set up, I started having problems with
what I thought was a fairly simple ASP feature.

<%
Class clsHREF
Dim child(10)
Sub init()
Dim i
For i = LBound(child) To UBound(child)
child(i) = ""
Next
End Sub
End Class

Dim objHREF
Set objHREF = new clsHREF
Call objHREF.init()
Response.Write(objHREF.child(1))
%>

The problem here is that the class level variables that are
dimensioned as arrays are not accessible in the class methods. Not
sure why the server does not recognize this construct, but it gives
the following script error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'LBound'
test.asp, line 7

All that really means is that the child attribute is not recognized
(especially not as an array that has a Lower Bound). Are there any
configuration issues on IIS that might cause it to have grief along
these lines? The non-class features seem to work ok, and I'm
connecting with the DB fine, but I can't grok why this would run
afoul.

Thanks,
Chris Rathman


Since you can't have a lower bound greater than zero in vbscript, the LBound
function is pretty superfluous. You may as well just substitute "0"
everywhere you have an LBound statement.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2
>Since you can't have a lower bound greater than zero in vbscript, the LBound
function is pretty superfluous. You may as well just substitute "0"
everywhere you have an LBound statement.


Bad habits that I supposed I picked up from my Pascal days.

The problem persists whether I used fixed constants or use the Bound functions.
I can change the offending statement to:

For i = 0 To 10

and still get an error - albeit one that probably is more descriptive of the
actual source of the problem.

Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'child'
/demo/aaa2.asp, line 7

Like I said, this code works fine on multiple other IIS boxes. It's just this
one new box that's thrown me for a loop.

Thanks,
Chris Rathman
Jul 19 '05 #3
ChrisRath wrote:
Since you can't have a lower bound greater than zero in vbscript,
the LBound function is pretty superfluous. You may as well just
substitute "0" everywhere you have an LBound statement.


Bad habits that I supposed I picked up from my Pascal days.

The problem persists whether I used fixed constants or use the Bound
functions. I can change the offending statement to:

For i = 0 To 10

and still get an error - albeit one that probably is more descriptive
of the actual source of the problem.

Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'child'
/demo/aaa2.asp, line 7

Like I said, this code works fine on multiple other IIS boxes. It's
just this one new box that's thrown me for a loop.

That IS strange. What does Vartype(child) return?
Does this problem effect non-class arrays?

I would try reinstalling the WSH.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #4
>That IS strange. What does Vartype(child) return?
Does this problem effect non-class arrays?

I would try reinstalling the WSH.


The problem didn't effect the non-class arrays. Before I found the VarType, I
tried your other suggestion of reinstallation (and updating). Low and behold,
the problem is cured. Thanks for the suggestion - I got so stuck in trying the
diagnose the nature of the problem, I didn't even think of checking the
installation.

Must've been that the ISP pulled a mirror from somewhere else and didn't get a
pristine copy. Thanks for the suggestion. Hopefully, I'll never see that
problem again. :-)
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Iain Bishop | last post by:
I'm trying to model objects for the following problem: A building site contains assemblies, each of which can contain other assemblies and/or materials. I have modelled this using a Site...
9
by: MLH | last post by:
I need a fundamental explanation of Class Modules - something suitable for newbies. Access 2.0 didn't seem to focus on them very much. Now that I'm using Access 97, it seems they're everywhere. thx...
14
by: Lee Franke | last post by:
I can't seem to figure this one out. Here is my class structure namespace name { public class foo { } }
15
by: Brian Haynes | last post by:
I am having a problem with overloading. An example: Public Class Base ... End Class Public Class Derived Inherits Base ... End Class
13
by: thomasp | last post by:
I have written my first Class and am posting it to this newsgroup with hopes that I can get some feedback on what is right and what is wrong with it. All comments are welcome, but more interested...
4
by: Bruno Baguette | last post by:
Hello, I've a strange problem with inheritance on PostgreSQL 7.4.1. It seems like tables don't inherits the primary key of the 'mother' table. Here's a little sample to show my problem : ...
13
by: andreas | last post by:
Hi, I want to do some calculation like ( t1 and t2 are known) for i = t1 to t2 for j = t1 to t2 ..... ..... for p = t1 to t2 for q = t1 to t2
3
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
1
by: DJG79 | last post by:
Hi all, I am using an open source menu that i found and it works great, except for one thing that when the web page is not scrolled to the very top the drop down links will not stay visible. Has...
4
by: shapper | last post by:
Hello, I have a class which I am using in my profile. I made this class Serializable by using: <Serializable()_ Public Class Options One of the properties in this class is of type Level...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.