Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function GetTF(gPatt As String, gFile As String, gA As String) As String
- Separators = "\"
- Dim D, LastHas, seper
- LastHas = InStr(1, gPatt, gA)
- If LastHas = 0 Then Exit Function
- seper = 0
- zseper = 0
- slen = 0
- For N = 1 To LastHas
- If InStr(1, Separators, Mid(gPatt, N, 1)) > 0 Then
- seper = seper + 1
- End If
- Next N
- For N = 1 To Len(gFile)
- If InStr(1, Separators, Mid(gFile, N, 1)) > 0 Then
- zseper = zseper + 1
- End If
- If seper = zseper Then Exit For
- Next N
- s = InStr(N + 1, gFile, Separators)
- If s > 0 Then
- lseper = s
- If s > 1 Then
- If InStr(1, " ", Mid(gFile, s - 1, 1)) > 0 Then
- lseper = s - 1
- End If
- End If
- GetTF = Trim(Mid(gFile, N, lseper - N))
- Else
- GetTF = Trim(Mid(gFile, N))
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement