Public Function PlugEvent(ByVal TheEvent As String, Optional Username As String, Optional Message As String) As String
On Error Resume Next 'GoTo PlugER
For i = 0 To UBound(PlugY) - 1
Chat True, True, vbRed, PlugL(i)
PlugEvent = PlugY(i).Run(TheEvent, Username, Message)
DoEvents
Next i
'Exit Function
'PlugER: MsgBox Err.Description
End Function
I call the above sub:
PlugEvent "Command", "CrAz3D", "\listresps"
If I have more than 1 object in the PlugY array, more than 1 that should return something, it replaces the previous response from a different plugin.
How could I make a single event (IE: Command1_Click()) return the response from multiple plugins?
Command1_Click()
Msgbox PlugEvent("Command", "CrAz3D", "\listresps")
Any help is appreciated.
Why don't you make PlugEvent an array?
It depends on how you want to treat the responses. Do you want them all concatenated? Do you want one messagebox per response?
I just ended up using an array, differently than having PlugEvent being an array.
How WOULD I make PlugEvent an array?