The way I have it setup is like this:
Exchange.vb
NetPhone.vb
Cl_Exchange.vb which is the class
Cl_Phone.vb which is the second class
The exchange has a public function to show the phone location in the array
This code is in the Cl_Exchange
Code:
Public Function whereAmI_inarray(ByVal telNum As String) As Integer
Dim Counter As Integer
For Counter = 1 To PhoneArray.Count - 1
If PhoneArray(Counter).whoami = telNum Then
Return Counter
End If
Next
End Function
This links in to this bit of code in Cl_Phone
Code:
Public Sub GetMyLocationFromExchange()
MyLocationInExchange = c_exchange.whereAmI_inarray(myNumber)
End Sub
The code above tells the phone being used to dial out where it is in the array the code below looks where the other phone that is being dialed is which is also in the Cl_Phone:
Code:
Public Sub GetCallingLocationFromExchange(ByVal num)
CalledLocationInExchange = c_exchange.whereAmI_inarray(num)
Me.c_exchange.callPhone(CalledLocationInExchange)
End Sub
That uses the same code in the Cl_Exchange to find the location then I have added another bit of code to activate the ring out class in the Cl_Phone.
This is in the Cl_Exchange:
Code:
Public Sub callPhone(ByVal location As Integer)
PhoneArray(location).ring()
End Sub
I will leave it at that for now.
Thanks for the response
Regards
x-2o