|
-
Jul 2nd, 2009, 09:20 PM
#1
Thread Starter
Addicted Member
Multiple Sending Problems
Here is my code:
Code:
Case "MODE" 'if someone sets the mode on someone
Dim p As Integer
For p = 0 To lstUsers.ListCount - 1
If lstUsers.Selected(p) = True Then
displaychat "** " + from$ + " sets mode " + processParam(processRest(params$)) + " on " + Me.lstUsers.Text + " **" 'display the mode change
Else
If lstUsers.Selected(p) = False Then
displaychat "** " + from$ + " sets mode " + processParam(processRest(params$)) + " on " + processParam(params$) + " **" 'display the mode change
End If
End If
Next
What I'm trying to say is if a user is selected in the lstUsers, then send isplaychat "** " + from$ + " sets mode " + processParam(processRest(params$)) + " on " + Me.lstUsers.Text + " **"
If a user is not selected in lstUsers, then send displaychat "** " + from$ + " sets mode " + processParam(processRest(params$)) + " on " + processParam(params$) + " **"
But it sends the message twice still. I don't know what code to use.
-
Jul 2nd, 2009, 10:01 PM
#2
Re: Multiple Sending Problems
Try this:
Code:
Case "MODE" 'Someone set mode on someone else
Dim p As Integer
'If there is at least one selected user, then...
If lstUsers.SelCount > 0 Then
'Loop through all users in list
For p = 0 To lstUsers.ListCount - 1
If lstUsers.Selected(p) Then
displaychat "** " + From$ + " sets mode " + processParam(processRest(params$)) + " on " + Me.lstUsers.Text + " **" 'display the mode change
End If
Next p
Else
'No selected users
displaychat "** " + From$ + " sets mode " + processParam(processRest(params$)) + " on " + processParam(params$) + " **" 'display the mode change
End If
Also, you should get in the habbit of indenting and spacing out your code. See how much easier that is to read?
-
Jul 2nd, 2009, 10:27 PM
#3
Thread Starter
Addicted Member
Re: Multiple Sending Problems
Alright I will. And thanks a lot DigiRev, it worked.
-
Jul 2nd, 2009, 10:32 PM
#4
Re: Multiple Sending Problems
You're welcome.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|