NewsBot
1
I'm currently trying to implement an enumerator class, but I can't seem to get it to work. Here is the code.
Private Class CEnumerator
*** Implements IEnumerator
Private pArr As Array
Private index As Integer
Public Sub New(ByVal pArr As Array)
***Me.pArr = pArr
***index = -1
End Sub ' New
Public ReadOnly Property Current() As Object Implements IEnumerator.Current
Get
***Return pArr(index)
End Get
...
...
That part keeps giving me the "disallows late binding" error.
I know I can just declare pArr as an Object array and be done with this mess, but I just want to know why can't I just return whats in*pArr(index) as an object?
More...
View All Our Microsoft Related Feeds
Private Class CEnumerator
*** Implements IEnumerator
Private pArr As Array
Private index As Integer
Public Sub New(ByVal pArr As Array)
***Me.pArr = pArr
***index = -1
End Sub ' New
Public ReadOnly Property Current() As Object Implements IEnumerator.Current
Get
***Return pArr(index)
End Get
...
...
That part keeps giving me the "disallows late binding" error.
I know I can just declare pArr as an Object array and be done with this mess, but I just want to know why can't I just return whats in*pArr(index) as an object?
More...
View All Our Microsoft Related Feeds