Я новичок самой начальной стадии. Не могу понять как прописать условие при котором не будет выхода за границы массива?
- Код: Выделить всё
UserName = "111"
UserPass = "222"
ServerName = "333"
BaseName = "444"
pn = 10
Dim Connector
Dim AgentConnection
Dim Cluster
Dim WorkingProcess
Dim WorkingProcessConnection
Dim ibDesc
Dim connections
Dim ConnectString
Dim StdOut
Set StdOut = WScript.StdOut
Set Connector = CreateObject("V82.COMConnector")
Set AgentConnection = Connector.ConnectAgent(ServerName)
Set Cluster = AgentConnection.GetClusters()(0)
AgentConnection.Authenticate Cluster, "", ""
Dim p
For p = 0 To pn
Set WorkingProcess = AgentConnection.GetWorkingProcesses(Cluster)(p)
ConnectString = WorkingProcess.HostName & ":" & WorkingProcess.MainPort
Set WorkingProcessConnection = Connector.ConnectWorkingProcess(ConnectString)
WorkingProcessConnection.AddAuthentication UserName, UserPass
Set ibDesc = WorkingProcessConnection.CreateInfoBaseInfo()
ibDesc.Name = BaseName
Connections = WorkingProcessConnection.GetInfoBaseConnections(ibDesc)
Dim i
Dim Connection
For i = LBound(Connections) To UBound(Connections)
set Connection = connections(i)
If (Connection.AppID <> "COMConsole") then
'StdOut.WriteLine(Connection.UserName)
WorkingProcessConnection.Disconnect Connection
End if
Next 'i
Next 'p
[Viper] :: Используй тэг CODE!