B
Bmack500
I'm definitely doing something wrong here. I have a class called
Servers, implemented as below. I then create my collection as below.
Then, I'll add a server object to the collection as follows:
Dim sServer as New Server
sServer.Path(iIndex2) = "servername"
serversCollection.Add(sServer)
No problems. Then I try and access a variable like this:
For i = 0 To (serversCollection.Count - 1)
serversCollection.Item(i).Path = "\\servername\path\"
Next
I'm always getting "option strict disallows late binding" when trying
to assign a value to one of the server objects in the collection.
What am I doing wrong?
'*************Create Collection************************
Private serversCollection As New System.Collections.ArrayList
Public Property sServer(ByVal I As Integer) As Server
Get
Return CType(serversCollection(I), Server)
End Get
Set(ByVal Value As Server)
serversCollection(I) = Value
End Set
End Property
'************Server Class*******************************
Public Class Server
Public mPath As String
Default Public Property Path(ByVal I As Integer) As String
Get
Return mPath
End Get
Set(ByVal Value As String)
mPath = Value
End Set
End Property
'Public InstanceName As String
Public Name As String
Public Nick As String
Public Status As String
Public newDat As Integer
Public newEngine As Integer
Public oldDat As Integer
Public oldEngine As Integer
Public datChange As Boolean
Public engineChange As Boolean
Public updateCycle As Boolean
Public contactFailure As Boolean
Public NumContactFailures As Integer
Public NumUpdateCycles As Integer
End Class
Servers, implemented as below. I then create my collection as below.
Then, I'll add a server object to the collection as follows:
Dim sServer as New Server
sServer.Path(iIndex2) = "servername"
serversCollection.Add(sServer)
No problems. Then I try and access a variable like this:
For i = 0 To (serversCollection.Count - 1)
serversCollection.Item(i).Path = "\\servername\path\"
Next
I'm always getting "option strict disallows late binding" when trying
to assign a value to one of the server objects in the collection.
What am I doing wrong?
'*************Create Collection************************
Private serversCollection As New System.Collections.ArrayList
Public Property sServer(ByVal I As Integer) As Server
Get
Return CType(serversCollection(I), Server)
End Get
Set(ByVal Value As Server)
serversCollection(I) = Value
End Set
End Property
'************Server Class*******************************
Public Class Server
Public mPath As String
Default Public Property Path(ByVal I As Integer) As String
Get
Return mPath
End Get
Set(ByVal Value As String)
mPath = Value
End Set
End Property
'Public InstanceName As String
Public Name As String
Public Nick As String
Public Status As String
Public newDat As Integer
Public newEngine As Integer
Public oldDat As Integer
Public oldEngine As Integer
Public datChange As Boolean
Public engineChange As Boolean
Public updateCycle As Boolean
Public contactFailure As Boolean
Public NumContactFailures As Integer
Public NumUpdateCycles As Integer
End Class