Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: CrAz3D on May 29, 2004, 02:32 PM

Title: Multiple Responses
Post by: CrAz3D on May 29, 2004, 02:32 PM
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.
Title: Re:Multiple Responses
Post by: Noodlez on June 01, 2004, 08:57 AM
Why don't you make PlugEvent an array?
Title: Re:Multiple Responses
Post by: Adron on June 01, 2004, 09:38 AM
It depends on how you want to treat the responses. Do you want them all concatenated? Do you want one messagebox per response?
Title: Re:Multiple Responses
Post by: CrAz3D on June 01, 2004, 12:02 PM
I just ended up using an array, differently than having PlugEvent being an array.

How WOULD I make PlugEvent an array?