Results 1 to 14 of 14

Thread: What is wrong with this select case?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98

    What is wrong with this select case?

    Code:
    If InStr(x, ".") > 0 Then
                x = Trim(x)
                'x = UCase(x)
                Select Case x
                    Case ".HELP"
                        send("PRIVMSG " & channel & " :" & "IRC bot written by Azkar (#BAH-NS)" & vbCrLf)
                    Case ".help"
                        send("PRIVMSG " & channel & " :" & "IRC bot written by Azkar (#BAH-NS)" & vbCrLf)
                    Case Else
    
                        send("PRIVMSG " & channel & " :" & x & vbCrLf)
                End Select
            End If
    the else works, and the x output is exactally what should trigger the select case.

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Your problem is the value of x.
    Put a breakpoint on the line 'select case x', and run the program.

    When the code stops at your breakpoint, hover your mouse over the X variable, and examine what it reads.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98
    Ah, thanks, it had a VBcrlf in it, how can I trim that out?

  4. #4
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    i would have figured the trim() statement you have would take care of that. .

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98
    it didnt.

    x still = ".HELP
    "

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Azkar
    it didnt.

    x still = ".HELP
    "
    What do you want to do ?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98
    I want to remove the vbcrlf after the .help, strip x of its vbcrlf

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Do you have any example of a string that contain vbcrlf ?

  9. #9

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98



    notice that x in the autos window is .HELP[](boxy thing)

    when i delete the box, it give me the desired output...

  10. #10
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    What's with the

    Do Until 1<>1 bit??????
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  11. #11
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this
    VB Code:
    1. x = x.Trim(vbCrLf.ToCharArray())

  12. #12

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98
    ahhh... thanks, that worked.

  13. #13
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Originally posted by taxes
    Hi,

    What's with the

    Do Until 1<>1 bit??????
    I think that's just another way of Do While True. He's got two conditions that will break him out of the loop, one is guaranteed to run. Can't see where he needs it though.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    98
    yeah, i changed it around a whole lot, so i could do it using a different kind of loop, just didnt bother

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