Results 1 to 10 of 10

Thread: [RESOLVED] How to use Left(or something like it)

Hybrid View

  1. #1
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Re: How to use Left(or something like it)

    You can use the replace function to get rid of it.

    strMessage = replace(strMessage, "BOX:", "")
    Here's to us!
    Who's like us?
    Darned few, and they're all dead!

  2. #2
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: How to use Left(or something like it)

    Quote Originally Posted by demotivater
    You can use the replace function to get rid of it.

    strMessage = replace(strMessage, "BOX:", "")
    good one sorry did not see that.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    73

    Re: How to use Left(or something like it)

    this is what im trying to do

    SERVER
    VB Code:
    1. Form1.winsock.SendData "BOX:" & txtmsg.Text

    Client
    VB Code:
    1. If strinput = "BOX:" Then
    2. stroutput = Replace(incommingData, "BOX:", "")
    3. msgbox stroutput, vbCritical, "Admin Message"
    4. End If

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: How to use Left(or something like it)

    Or this:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Dim t$
    5.   t = "Box: test"
    6.   MsgBox Trim(Right$(t, InStr(t, ":")))
    7. End Sub

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    73

    Re: How to use Left(or something like it)

    none of those things are working can you give me some other things?

  6. #6
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Re: How to use Left(or something like it)

    How is the variable "incomingdata" being filled?

    Try something like this (assumes strinput is from winsock send data)

    VB Code:
    1. If InStr(strinput, "BOX:") > 0 Then
    2.     stroutput = Replace(strinput, "BOX:", "")
    3.     MsgBox stroutput, vbCritical, "Admin Message"
    4. End If
    Here's to us!
    Who's like us?
    Darned few, and they're all dead!

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    73

    Re: How to use Left(or something like it)

    Quote Originally Posted by demotivater
    How is the variable "incomingdata" being filled?

    Try something like this (assumes strinput is from winsock send data)

    VB Code:
    1. If InStr(strinput, "BOX:") > 0 Then
    2.     stroutput = Replace(strinput, "BOX:", "")
    3.     MsgBox stroutput, vbCritical, "Admin Message"
    4. End If

    thanks man that works perfect

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