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:
Public Function BreakStr(ByVal Text As String, ByVal Char As String, ByVal Where As Integer) As String 'Very useful function Dim i As Long, temp As String, m As Long For i = 1 To Len(Text) temp = Mid(Text, i, Len(Char)) If temp = Char Then m = i If Where = 1 Then 'before temp = Mid(Text, 1, m - 1) BreakStr = temp Exit Function Else temp = Mid(Text, m + Len(Char), Len(Text)) BreakStr = temp Exit Function End If End If Next If Where = 1 Then BreakStr = Text End Function




Reply With Quote