Results 1 to 17 of 17

Thread: [RESOLVED] Search line in multi line textbox

Threaded View

  1. #6
    Hyperactive Member
    Join Date
    Aug 2006
    Location
    TeXaS
    Posts
    497

    Re: Search line in multi line textbox

    here is a simple example i just whipped up for the parsing part. its a bit long but it will work for multiple tags. i hope its not too complicated for you to understand.

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    
    'call the function here
    Me.Caption = ParseTextInBetween(Text1.Text, "<brfor=", ">")
    
    End Sub
    
    Private Function ParseTextInBetween(ByVal MyString as String, ByVal pTagStart As String, ByVal pTagStop As String) As String
    
        Dim BgnTagPos As Long, EndTagPos As Long
        
        BgnTagPos = InStr(MyString, pTagStart) 'find the start of the tag we want.
        
        If BgnTagPos Then
            BgnTagPos = BgnTagPos + Len(pTagStart) 'adding here so i dont have to do it 3 times in rest of the code
            EndTagPos = InStr(BgnTagPos, MyString, pTagStop) 'find '>'
            If EndTagPos Then
                ParseTextInBetween = Mid$(MyString, BgnTagPos, EndTagPos - BgnTagPos) 'grab the data in between BgnTagPos and EndTagPos
            End If
        End If
    
    End Function
    EDIT: im pretty sure it doesn't matter but add the bold text.
    Last edited by Billy Conner; Jul 14th, 2009 at 05:35 PM. Reason: modified code

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