Results 1 to 14 of 14

Thread: Language Filterd(Semi Resolved)

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41

    Language Filterd(Semi Resolved)

    I'm experimenting with check boxes, and so far I have bold, italic etc. etc. But I want to make it, so when you click one of these check boxes is, it will fill words such as "****" with "#&@&" but, I gave up on the idea to fill it with "#&@&" because I couldn't figure it out, so then I tried just deleting the work from the final showing. But now, I can't seem to get that to work, so anywayz, here's my code so far.

    Private Sub chkL_Click()

    If chkL.Value = vbChecked Then
    If LblUser.Caption = "****" Then
    LblUser.Caption = -"****" = True

    Else
    LblUser.Caption = -"****" = False


    End If
    End If

    End Sub

    If there is a way to fill in the word with simbols, please let me know!!
    Last edited by shishkabob; Feb 22nd, 2004 at 08:10 PM.
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236
    First of all you should be getting errors with your code.

    VB Code:
    1. If chkL.Value = vbChecked Then
    2. If LblUser.Caption = "****" Then
    3. 'LblUser.Caption is a Caption it can't = True only Enabled or Visible
    4. 'and you can't have (-)
    5. LblUser.Caption = -"****" = True
    6. LblUser.Caption = "****"
    7. Else
    8. LblUser.Caption = -"****" = False

    If you want specific characters in the caption then specify them "%$&@#" or use Chr$(Number). You will have to lookup the Numbers for the characters you want.

    I don't know why you called this Language Filter.


  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Try something like:

    VB Code:
    1. Function GetRandomChar(num As Long) As String
    2. Dim RandomNum As Long
    3. Randomize
    4. RandomNum = Rnd() * num
    5. If (RandomNum < 10) Then
    6.     GetRandomChar = "#"
    7. ElseIf (RandomNum > 10) And (RandomNum < 15) Then
    8.     GetRandomChar = "$"
    9. ElseIf (RandomNum > 15) And (RandomNum < 40) Then
    10.     GetRandomChar = "&"
    11. Else
    12.     GetRandomChar = "%"
    13. End If
    14. End Function
    15.  
    16. Function SymbolizeWord(str As String) As String
    17. Dim retString As String
    18. Dim thisChar As String
    19. Dim i As Long
    20.  
    21. For i = 1 To Len(str)
    22.     'loop through each character and make it a random character..
    23.     thisChar = Mid(str, i, 1)
    24.     retString = retString + GetRandomChar(50)
    25. Next i
    26.  
    27. SymbolizeWord = retString
    28. End Function
    29.  
    30.  
    31. Private Sub chkL_Click()
    32.  
    33. If chkL.Value = vbChecked Then
    34.     LblUser.Caption = SymbolizeWord(LblUser.Caption)
    35. End If
    36. End Sub

    Works fine..



    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    Private Sub chkL_Click()

    If chkL.Value = vbChecked Then ' If check box is clicked, then make the caption the same, without the word "f.u.c.k."

    LblUser.Caption = Replace(LblUser.Caption, "****", "&*%$") ' This is where the replacing begins, the **** is F.U.C.K.

    Else

    LblUser.Caption = (txtUser.Text)

    End If

    Kinda hard to explain, but here's my file... you will notice that you can check all the boxes before hand, then enter the text, then press the button, and the txt will show up in the lbl with the corrosponding attributes, but the language filter you have to wait intill txt is in the label.

    Example.. I put in (f.u.c.k) without the .'s but I don't click the User button yet, I check all the chk.. boxes then press the user button. All attributes are correct (text is bold, italec, etc) But, it dosn't censor the cuss word intil after you unclick the lang. chk box, and then reclick it, (why is this?)
    Attached Files Attached Files
    Last edited by shishkabob; Feb 22nd, 2004 at 06:15 PM.
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  5. #5
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    That's hard to say without seeing the code, but apparently when you click the command button you don't check the value of the checkbox. You have to do that; so just insert this code in the Command_Click sub (I suppose it's not there yet...).
    VB Code:
    1. If chkL.Value = vbChecked Then ' If check box is clicked, then make the caption the same, without the word "f.u.c.k."
    2.  
    3. LblUser.Caption = Replace(LblUser.Caption, "****", "&*%$") ' This is where the replacing begins, the **** is F.U.C.K.
    4.  
    5. Else
    6.  
    7. LblUser.Caption = (txtUser.Text)
    8.  
    9. End If
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    Still a no go...... it dosn't change the text, when cmd button is clicked. Can't figure it out, would I have to use a for... do loop??? ex.. for every **** in lblUser.caption ????
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    ???

    LblUser.caption = replace(LblUser.caption,"bunny","#$%$")

    should work. maybe it isn't case sensitive? add the line

    Option Compare Text

    at the VERY VERY TOP of the code.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  8. #8

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    yet still a no go, Do you guys want me to put my vb files up, and not the exe??
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    should I give up, and leave it as it is??? or what?
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  10. #10
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    yeh we don't open EXE's.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    here is my vb files, please help!!!
    Attached Files Attached Files
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  12. #12

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    I'm replying to keep this post on the page...
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  13. #13

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    I live in Oregon, U.S.A.
    Posts
    41
    once again, i'M replying to this so, it will stay on first page.
    I'm a noobie when it comes to programming, please teach me, so I can also have the advantages of making my own programs, and money.

  14. #14
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    jeez..........

    look at this line
    LblUser.Caption = Replace(LblUser.Caption, "****", "&*%$")

    I don't think you even looked at the code. If you can't find the problem then I don't know what to say. Look at even the comment AFTER the line (in your own code, not this line I copied out of it). It tells you what **** is suppose to be (since the forums filter swears).
    Remember, if someone's post was not helpful, you can always rate their post negatively .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width