Results 1 to 10 of 10

Thread: Do not understand this function stand for???

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    7

    Do not understand this function stand for???

    i'm newbie in VB6. Can somebody explain what is this function for? I get this function from internet and for learning knowledge. Thank you.


    VB Code:
    1. Public Function BreakStr(ByVal Text As String, ByVal Char As String, ByVal Where As Integer) As String 'Very useful function
    2. Dim i As Long, temp As String, m As Long
    3.  
    4. For i = 1 To Len(Text)
    5.     temp = Mid(Text, i, Len(Char))
    6.         If temp = Char Then
    7.             m = i
    8.             If Where = 1 Then 'before
    9.                     temp = Mid(Text, 1, m - 1)
    10.                     BreakStr = temp
    11.                     Exit Function
    12.             Else
    13.                     temp = Mid(Text, m + Len(Char), Len(Text))
    14.                     BreakStr = temp
    15.                     Exit Function
    16.             End If
    17.         End If
    18. Next
    19. If Where = 1 Then BreakStr = Text
    20. End Function
    Last edited by MartinLiss; Apr 29th, 2006 at 02:11 PM.

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