|
-
Sep 24th, 2000, 02:39 PM
#1
Thread Starter
New Member
well not really i just couldn't think of a good title
I have a command prompt and everything
but one command is like
/connect {IP address} and i want it to get the IP address
and heres my problem... I am using a case statement so i am using this :
Select Case message$
Case "Close"
End
------- Important Part ---------
Case Left(Text3.Text, 8) = "/Connect"
IP = Right(Text3.Text, (Len(Text3.Text)) - 9)
Text2.Text = Text2.Text + "Connecting to IP: " + IP
but that doesn't work...I don't know what is goin on PLEASE HELP!
-
Sep 24th, 2000, 02:47 PM
#2
Guru
You might want to remove the line with End in it.
-
Sep 24th, 2000, 02:49 PM
#3
you have to use END SELECT to finish a select case block, not just END on its own.
Does this help?
PS, do not use the plus sign to concatenate strings, always use the "&" operator instead.
-
Sep 24th, 2000, 02:59 PM
#4
Thread Starter
New Member
I have all the important stuff guys (End Select all that) I just put the part of the code that wasn't working... the end hasn't done anything so i don't think its that. i am still in the dark
-
Sep 24th, 2000, 03:36 PM
#5
Select Case message$
Case "Close"
End
------- Important Part ---------
BAD PART!!! --> Case Left(Text3.Text, 8) = "/Connect"
IP = Right(Text3.Text, (Len(Text3.Text)) - 9)
Text2.Text = Text2.Text + "Connecting to IP: " + IP
Case Left(Text3.Text, 8) = "/Connect" is not a correct syntax. Case always follows the "Select Case" and cannot have a condition. You should change Case into If:
Code:
if message$ = "Close" then End
------- Important Part ---------
If Left(Text3.Text, 8) = "/Connect" then
IP = Right(Text3.Text, (Len(Text3.Text)) - 9)
Text2.Text = Text2.Text + "Connecting to IP: " + IP
end if
-
Sep 24th, 2000, 03:41 PM
#6
How come Yonatan never noticed that?
Or is that what you mean?
Do you really mean what I think you mean?
-
Sep 24th, 2000, 03:47 PM
#7
Hyperactive Member
Listen to Escaflowne
Escaflowne is correct and I think gives you the answer you are after. The End statement is perfectly valid where you have it, however you must think of Select Case very literally. All of Case .. clauses between the Select and End Select are only the Right hand side of the comparison.
Code:
Select Case x
Case Is 1
Case 1,2,3
Case 1 To 5
Case 1+2+3
Case myFunction(1,2,3)
Case Else
End Select
All of the above are valid examples (there are probably more as well)
You will have to re-write your Select case or convert ot nested If..Then blocks.
Regards
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
|