jameswalt
asked on
Error with VBScript class instantiation
I have the following class created:
<%
Class ErrObject
Dim ErrorArray
Private Sub ErrorObject_Initialize
ErrorArray=Array()
End Sub
Sub addError(errorValue)
' Expand size of array by 1
Redim Preserve ErrorArray(UBound(ErrorArr ay)+1)
' Append error code to array
ErrorArray(UBound(ErrorArr ay)) = errorValue
End Sub
Function printError(beforePrintText , beforeErrorItemText, AfterErrorItemText, AfterPrintText)
Dim r
r = beforePrintText
for each x in ErrorArray
r = r & beforeErrorItemText & getErrorMessage(x) & afterErrorItemText
next
r = r & afterPrintText
printError = r
End Function
End Class
%>
I also have the following call to this class:
<%
Dim eo
eo = New ErrObject
%>
However, when I attempt to load the page, I get this error:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method
Is there something I'm doing wrong? This seems like a pretty obvious thing.
<%
Class ErrObject
Dim ErrorArray
Private Sub ErrorObject_Initialize
ErrorArray=Array()
End Sub
Sub addError(errorValue)
' Expand size of array by 1
Redim Preserve ErrorArray(UBound(ErrorArr
' Append error code to array
ErrorArray(UBound(ErrorArr
End Sub
Function printError(beforePrintText
Dim r
r = beforePrintText
for each x in ErrorArray
r = r & beforeErrorItemText & getErrorMessage(x) & afterErrorItemText
next
r = r & afterPrintText
printError = r
End Function
End Class
%>
I also have the following call to this class:
<%
Dim eo
eo = New ErrObject
%>
However, when I attempt to load the page, I get this error:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method
Is there something I'm doing wrong? This seems like a pretty obvious thing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!