|
-
Mar 30th, 2004, 08:39 PM
#1
Thread Starter
Lively Member
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.
-
Mar 30th, 2004, 10:03 PM
#2
I wonder how many charact
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.
-
Mar 31st, 2004, 06:48 AM
#3
Thread Starter
Lively Member
Ah, thanks, it had a VBcrlf in it, how can I trim that out?
-
Mar 31st, 2004, 08:28 AM
#4
Frenzied Member
i would have figured the trim() statement you have would take care of that. .
-
Mar 31st, 2004, 09:32 AM
#5
Thread Starter
Lively Member
it didnt. 
x still = ".HELP
"
-
Mar 31st, 2004, 09:40 AM
#6
Sleep mode
Originally posted by Azkar
it didnt. 
x still = ".HELP
"
What do you want to do ?
-
Mar 31st, 2004, 11:01 AM
#7
Thread Starter
Lively Member
I want to remove the vbcrlf after the .help, strip x of its vbcrlf
-
Mar 31st, 2004, 11:20 AM
#8
Sleep mode
Do you have any example of a string that contain vbcrlf ?
-
Mar 31st, 2004, 03:07 PM
#9
Thread Starter
Lively Member
notice that x in the autos window is .HELP[](boxy thing)
when i delete the box, it give me the desired output...
-
Mar 31st, 2004, 03:58 PM
#10
PowerPoster
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.
-
Mar 31st, 2004, 04:09 PM
#11
Sleep mode
Try this
VB Code:
x = x.Trim(vbCrLf.ToCharArray())
-
Mar 31st, 2004, 04:42 PM
#12
Thread Starter
Lively Member
ahhh... thanks, that worked.
-
Mar 31st, 2004, 04:44 PM
#13
Frenzied Member
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.
-
Mar 31st, 2004, 07:56 PM
#14
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|