Link to home
Start Free TrialLog in
Avatar of jameswalt
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(ErrorArray)+1)

                  ' Append error code to array
                  ErrorArray(UBound(ErrorArray)) = 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.
ASKER CERTIFIED SOLUTION
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jameswalt
jameswalt

ASKER

wow... that was way too easy. lot of wasted time for something so silly.

thanks!