MSComm array?? MSComm.CommEvent

have MSComm array MSComm3(0),MSComm3(1),MSComm3(2).. but i can't get this code to work,,

Compile error:

Procedure declaration does not match description of event or procedure having the same name.

how do i solve this problem. thx..  


Code:

Public Sub MSComm3_OnComm()

    If frmMain.MSComm3.CommEvent <> 2 Then
        Exit Sub
    End If
     

    Select Case MSComm3(0).CommEvent
        Case comEvReceive
                    .........
    End Select
     

    Select Case MSComm3(1).CommEvent
        Case comEvReceive
    ................
    End Select
     

    Select Case MSComm3(2).CommEvent
        Case comEvReceive
    ......................
     End Select


End sub

can i use an array with this control. or must i have a MSComm1_OnComm, MSComm2_OnComm and so on...

thx :)
LVL 1
NissePPPAsked:
Who is Participating?
 
GrahamSkanConnect With a Mentor RetiredCommented:
You seem to have lost the index paramenter form the event.

It should look like this

Private Sub MSComm1_OnComm(Index As Integer)

End Sub

0
All Courses

From novice to tech pro — start learning today.