Hello,
Simple sample for my workflow :
In Design stage I have created TCPSocket, Label, Canvas.
All objecs has Index=0.
On Open event of window I have code like:
Dim TCP as TCPSocket, Lab as Label, Can as Canvas
For i=1 to AppsCount
TCP = new TCPSocket
Lab= new Label
Can= new Canvas
TCP.Address=IP(i)
TCP.Port=Prt(i)
TCP.Connect
Lab.text=str(IP(i))
Next
Where IP() and Prt() are global variables predefined by user.
This is way how I create arrays.
Then on DataAvailable event of TCPSocket I have code like:
Sub DataAvailable(index as Integer)
Dim LSData as string
LSData=me.ReadAll
dim plm as string=MG_ParseListener(LSData,"PLAYMODE")
select case plm
case "play"
Canvas(index).Backdrop=play
case "stop"
Canvas(index).Backdrop=stop
case "cue"
Canvas(index).Backdrop=cue
case "pause"
Canvas(index).Backdrop=pause
end select
End Sub
Where MG_ParseListener function returns one of status used in select case .
Code is more complicated, but this is way how I used TCPSocket array.
On each DataAvailable I got unresponsive app.
Martin