| View previous topic :: View next topic |
| Pick 1 |
| This is very good. |
|
0% |
[ 0 ] |
| This is awesome! |
|
100% |
[ 1 ] |
| This is cool! |
|
0% |
[ 0 ] |
|
| Total Votes : 1 |
|
| Author |
Message |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Feb 17, 2008 7:58 am Post subject: {Noobish} word filtering |
|
|
| Code: | Dim a(4) As String
Private Sub Command1_Click()
For i = 0 To 4
If InStr(Text1, a(i)) Then
'Put code here, for instance you can use this hot messagebox.
MsgBox "the word " & a(i) & " is not allowed"
End If
Next i
End Sub
Private Sub Form_Load()
a(0) = "person with a high concentration of pigment in his skin"
a(1) = "hoe"
a(2) = "slut"
a(3) = "cam"
a(4) = "xxx"
End Sub |
_________________
Intel over amd yes.
Last edited by NINTENDO on Sun Feb 17, 2008 11:06 am; edited 3 times in total |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Feb 17, 2008 8:00 am Post subject: |
|
|
| Wtf? Why post this?
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Feb 17, 2008 8:02 am Post subject: |
|
|
| noz3001 wrote: | | Wtf? Why post this? |
I have no idea.
Why even bother visiting the thread if ur not interested.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Feb 17, 2008 8:27 am Post subject: |
|
|
| Naablet wrote: | | noz3001 wrote: | | Wtf? Why post this? |
I have no idea.
Why even bother visiting the thread if ur not interested. |
It could have been something a bit more interesting than string comparison in VB.
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Feb 17, 2008 8:33 am Post subject: |
|
|
| noz3001 wrote: | | Naablet wrote: | | noz3001 wrote: | | Wtf? Why post this? |
I have no idea.
Why even bother visiting the thread if ur not interested. |
It could have been something a bit more interesting than string comparison in VB. |
oh. I see.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sun Feb 17, 2008 8:37 am Post subject: |
|
|
| I don't see "This sucks" option...
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Feb 17, 2008 8:56 am Post subject: |
|
|
| HolyBlah wrote: | | I don't see "This sucks" option... |
that's becuase it dosen't suck.
Maby you are to read the topic once more. Noobish dosen't sound very advanced.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sun Feb 17, 2008 10:12 am Post subject: |
|
|
| Naablet wrote: | | HolyBlah wrote: | | I don't see "This sucks" option... |
that's becuase it dosen't suck.
Maby you are to read the topic once more. Noobish dosen't sound very advanced. |
Yes, but because of the bad grammar, it makes one thing that you are filtering "noobish" words.
Rather, you should wrap the "Noobish" in brackets ( [ ] ). That will state the difficulty level, and actually specify what this is doing.
_________________
|
|
| Back to top |
|
 |
AlienX-P Advanced Cheater
Reputation: 0
Joined: 31 Jan 2008 Posts: 52
|
Posted: Sun Feb 17, 2008 11:15 am Post subject: |
|
|
You didn't state what language it is in..
(But obviously, it's vb)
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Feb 17, 2008 1:51 pm Post subject: |
|
|
Save yourself the space, don't array words out like that, instead you can do something like this:
| Code: | Option Explicit
Private Sub Command1_Click()
Dim x As Long
For x = 0 To (UBound(WordArray) - LBound(WordArray))
If InStr(1, Text1.Text, WordArray(x)) Then
MsgBox "bad word found"
End If
Next x
End Sub
Private Function WordArray()
WordArray = Array("hoe", "slut", "xxx")
End Function
|
_________________
- Retired. |
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed Feb 20, 2008 3:45 pm Post subject: |
|
|
| Wiccaan wrote: | Save yourself the space, don't array words out like that, instead you can do something like this:
| Code: | Option Explicit
Private Sub Command1_Click()
Dim x As Long
For x = 0 To (UBound(WordArray) - LBound(WordArray))
If InStr(1, Text1.Text, WordArray(x)) Then
MsgBox "bad word found"
End If
Next x
End Sub
Private Function WordArray()
WordArray = Array("hoe", "slut", "xxx")
End Function
|
|
Cool, thx i like it!!
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
|