I cleared it out:(Quote:
Originally posted by Pc_Madness
Check the Sent Items?? Maybe it will have a quote of the needed code in it??
Printable View
I cleared it out:(Quote:
Originally posted by Pc_Madness
Check the Sent Items?? Maybe it will have a quote of the needed code in it??
Quote:
Originally posted by Nightwalker83
I cleared it out:(
PM McBrain for it then?? He may still have it.
What does the code do?
mc Brain posted all the code I asked for. I got the code I'm looking for from Bruce. The code need makes the txtmess.text = txtmess.text & data
Oh ok. :)
Yeah I suppose I can wait but this is really p*ssing me off.Quote:
Originally posted by Pc_Madness
Oh ok. :)
Quote:
Originally posted by Nightwalker83
Yeah I suppose I can wait but this is really p*ssing me off.
Ok.... explain to me exactly what your trying to do, as I should be able to give you the code for it...
I was under the impression you just wanted to add the new message to the Main Chat (txtmess)
VB Code:
Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sInputArr() As String Dim sInputBuff As String: sInputBuff = mess Messlis(intmax).GetData str 'Get the message string If InStr(1, str, "|MESSAGE|") <> 0 Then mess = Mid$(str, 10, Len(str)) Dim objFrmMain As New frmMain sInputBuff = mess 'Load the string buffer with the INCOMMING message (wich may contain swear words!) End If 'Check to see if there is data in the listbox that matches the message string 'Split up the String into the Array If InStr(sInputBuff, " ") Then 'More than 1 word, so split sInputArr = Split(sInputBuff, " ") Else ReDim sInputArr(0) 'Only 1 word, so place it in the Array sInputArr(0) = sInputBuff End If For x = 0 To UBound(sInputArr) For a = 0 To frmSetup.Lstblock.ListCount - 1 If UCase(frmSetup.Lstblock.List(a)) = UCase(sInputArr(x)) Then sInputArr(x) = String(Len(frmSetup.Lstblock.List(a)), "*") txtMess.Text = Join(sInputArr, " ") 'Write out to the TextBox the 'corrected' message text. ie hashed out the swear words. txtMess.SelStart = Len(txtMess.Text) Next a Next x End Sub
That doesn't work because it will just over write who was in the box instead of adding it.
VB Code:
Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sInputArr() As String Dim sInputBuff As String: sInputBuff = mess Messlis(intmax).GetData str 'Get the message string If InStr(1, str, "|MESSAGE|") <> 0 Then mess = Mid$(str, 10, Len(str)) Dim objFrmMain As New frmMain sInputBuff = mess 'Load the string buffer with the INCOMMING message (wich may contain swear words!) End If 'Check to see if there is data in the listbox that matches the message string 'Split up the String into the Array If InStr(sInputBuff, " ") Then 'More than 1 word, so split sInputArr = Split(sInputBuff, " ") Else ReDim sInputArr(0) 'Only 1 word, so place it in the Array sInputArr(0) = sInputBuff End If For x = 0 To UBound(sInputArr) For a = 0 To frmSetup.Lstblock.ListCount - 1 If UCase(frmSetup.Lstblock.List(a)) = UCase(sInputArr(x)) Then sInputArr(x) = String(Len(frmSetup.Lstblock.List(a)), "*") 'this the bit??? txtMess.Text = txtMess.text + vbcrlf + Join(sInputArr, " ") 'Write out to the TextBox the 'corrected' message text. ie hashed out the swear words. txtMess.SelStart = Len(txtMess.Text) Next a Next x End Sub
Yeah ;)Quote:
Originally posted by Pc_Madness
VB Code:
Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sInputArr() As String Dim sInputBuff As String: sInputBuff = mess Messlis(intmax).GetData str 'Get the message string If InStr(1, str, "|MESSAGE|") <> 0 Then mess = Mid$(str, 10, Len(str)) Dim objFrmMain As New frmMain sInputBuff = mess 'Load the string buffer with the INCOMMING message (wich may contain swear words!) End If 'Check to see if there is data in the listbox that matches the message string 'Split up the String into the Array If InStr(sInputBuff, " ") Then 'More than 1 word, so split sInputArr = Split(sInputBuff, " ") Else ReDim sInputArr(0) 'Only 1 word, so place it in the Array sInputArr(0) = sInputBuff End If For x = 0 To UBound(sInputArr) For a = 0 To frmSetup.Lstblock.ListCount - 1 If UCase(frmSetup.Lstblock.List(a)) = UCase(sInputArr(x)) Then sInputArr(x) = String(Len(frmSetup.Lstblock.List(a)), "*") 'this the bit??? txtMess.Text = txtMess.text + vbcrlf + Join(sInputArr, " ") 'Write out to the TextBox the 'corrected' message text. ie hashed out the swear words. txtMess.SelStart = Len(txtMess.Text) Next a Next x End Sub
When it snd the data the other txtmess.text:
Data
instead of
Data
Data
Have you tried my code??
"Nope, oh, and heres your ice cream that I wouldn't give to you the other day cause I was being a......"
:D
Yeah but it sends about four lines at once when I only need one.Quote:
Originally posted by Pc_Madness
"Nope, oh, and heres your ice cream that I wouldn't give to you the other day cause I was being a......"
:D
Of the same text?
[EXAMPLE]Quote:
Originally posted by Pc_Madness
Of the same text?
I send "hello"
I get:
Helllo
Hello
Hello
Hello
[EXAMPLE]
Instead of:
[EXAMPLE]
I send "Hello"
I get
Hello
Well.... logic would say that the link is reposting the message 4 times.
But....
VB Code:
Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sInputArr() As String Dim sInputBuff As String: sInputBuff = mess Messlis(intmax).GetData str 'Get the message string If InStr(1, str, "|MESSAGE|") <> 0 Then mess = Mid$(str, 10, Len(str)) Dim objFrmMain As New frmMain sInputBuff = mess 'Load the string buffer with the INCOMMING message (wich may contain swear words!) End If 'Check to see if there is data in the listbox that matches the message string 'Split up the String into the Array If InStr(sInputBuff, " ") Then 'More than 1 word, so split sInputArr = Split(sInputBuff, " ") Else ReDim sInputArr(0) 'Only 1 word, so place it in the Array sInputArr(0) = sInputBuff End If For x = 0 To UBound(sInputArr) For a = 0 To frmSetup.Lstblock.ListCount - 1 If UCase(frmSetup.Lstblock.List(a)) = UCase(sInputArr(x)) Then sInputArr(x) = String(Len(frmSetup.Lstblock.List(a)), "*") 'this the bit??? txtMess.Text = txtMess.text + Join(sInputArr, " ") 'Write out to the TextBox the 'corrected' message text. ie hashed out the swear words. Doevents txtMess.SelStart = Len(txtMess.Text) Doevents Next a Next x End Sub
If that doesn't work... try taking the "Next a" bit and placing it above the txtMess.text = txtmess.text .... bit.
Sorry but that didn't help.Quote:
Originally posted by Pc_Madness
Well.... logic would say that the link is reposting the message 4 times.
But....
VB Code:
Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sInputArr() As String Dim sInputBuff As String: sInputBuff = mess Messlis(intmax).GetData str 'Get the message string If InStr(1, str, "|MESSAGE|") <> 0 Then mess = Mid$(str, 10, Len(str)) Dim objFrmMain As New frmMain sInputBuff = mess 'Load the string buffer with the INCOMMING message (wich may contain swear words!) End If 'Check to see if there is data in the listbox that matches the message string 'Split up the String into the Array If InStr(sInputBuff, " ") Then 'More than 1 word, so split sInputArr = Split(sInputBuff, " ") Else ReDim sInputArr(0) 'Only 1 word, so place it in the Array sInputArr(0) = sInputBuff End If For x = 0 To UBound(sInputArr) For a = 0 To frmSetup.Lstblock.ListCount - 1 If UCase(frmSetup.Lstblock.List(a)) = UCase(sInputArr(x)) Then sInputArr(x) = String(Len(frmSetup.Lstblock.List(a)), "*") 'this the bit??? txtMess.Text = txtMess.text + Join(sInputArr, " ") 'Write out to the TextBox the 'corrected' message text. ie hashed out the swear words. Doevents txtMess.SelStart = Len(txtMess.Text) Doevents Next a Next x End Sub
You might have to upload your project... cause I can't work out whats going on with these loops. This is the code for moving the Next a.
VB Code:
Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sInputArr() As String Dim sInputBuff As String: sInputBuff = mess Messlis(intmax).GetData str 'Get the message string If InStr(1, str, "|MESSAGE|") <> 0 Then mess = Mid$(str, 10, Len(str)) Dim objFrmMain As New frmMain sInputBuff = mess 'Load the string buffer with the INCOMMING message (wich may contain swear words!) End If 'Check to see if there is data in the listbox that matches the message string 'Split up the String into the Array If InStr(sInputBuff, " ") Then 'More than 1 word, so split sInputArr = Split(sInputBuff, " ") Else ReDim sInputArr(0) 'Only 1 word, so place it in the Array sInputArr(0) = sInputBuff End If For x = 0 To UBound(sInputArr) For a = 0 To frmSetup.Lstblock.ListCount - 1 If UCase(frmSetup.Lstblock.List(a)) = UCase(sInputArr(x)) Then sInputArr(x) = String(Len(frmSetup.Lstblock.List(a)), "*") 'this the bit??? Next a txtMess.Text = txtMess.text + Join(sInputArr, " ") 'Write out to the TextBox the 'corrected' message text. ie hashed out the swear words. Doevents txtMess.SelStart = Len(txtMess.Text) Doevents Next x End Sub
I've solved the problem:)Quote:
Originally posted by Pc_Madness
If that doesn't work... try taking the "Next a" bit and placing it above the txtMess.text = txtmess.text .... bit.
I have another one:)
With that code I submitted I need to hash out words that aren't allow. I can do this but not all the words in the listbox are hashed out.
With that code above?
Don't you have to create a list of words and then check if any of them words in message match up with some of words in the naughty list?