Results 1 to 4 of 4

Thread: Chat box and command box

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Talking

    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

  2. #2
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161
    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15
    Ok thanks, I even think I might be able to turn what you told me into what I needed, we'll see. Thanks again.

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Talking

    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
  •  



Click Here to Expand Forum to Full Width