• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

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.
0
jameswalt
Asked:
jameswalt
1 Solution
 
Saqib KhanSenior DeveloperCommented:
you missing "Set"

<%
            Dim eo
            Set eo = New ErrObject
%>
0
 
jameswaltAuthor Commented:
wow... that was way too easy. lot of wasted time for something so silly.

thanks!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now