|
-
May 6th, 2000, 07:50 AM
#1
Thread Starter
New Member
I'm needing a code where I can type in something in in a text box, and it reads the first word of it, exampe:
If I type chat something
It prints this in the label box: You chat:Hello
If I type buy something
It prints: You bought something
-
May 6th, 2000, 06:36 PM
#2
Addicted Member
here's an example how you can do this:
Code:
'codes: /c to chat, /b to buy, /q to quit, /s to shout
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text1.Text = ""
CheckForCommand Text1.Text
End Sub
Sub CheckForCommand(CText As String)
If Left(CText, 1) = "/" Then
Select Case UCase$(Mid$(CText, 2, 1))
Case "B"
'user wants to buy something
Case "C"
'user chats
Case "Q"
'user wants to quit
Case "S"
'user shouts
End Select
End If
End Sub
[Edited by Razzle on 05-07-2000 at 07:36 AM]
Razzle
ICQ#: 31429438
What is the difference between a raven?
-The legs. The length is equal, especially the right one. 
-
May 6th, 2000, 10:55 PM
#3
Thread Starter
New Member
Ok thanks, I even think I might be able to turn what you told me into what I needed, we'll see. Thanks again.
-
May 6th, 2000, 11:14 PM
#4
Thread Starter
New Member
How can I get the program to read just what's after the /b or /c then?
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
|