home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / ProjectX1_562922192002.psc / ModulesCode / modCodeX9.bas < prev   
Encoding:
BASIC Source File  |  1997-02-19  |  1.2 KB  |  92 lines

  1. Attribute VB_Name = "modCodeX9"
  2.  
  3. Option Explicit
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. Public Function TvExtractT(ExtractType As Integer, InputText As String) As String
  13. '-----------------------------------
  14. '-   TvExtractT(ExtractType, InputText)
  15. '-
  16. '- ExtractType is 1/2 (1=filelocation,2=pathlocation)
  17. '-   InputText is the file path
  18. '-
  19. '- It'll return the path or file
  20. '-
  21. '-   By T-Virus Creations
  22. '- http://www.tvirusonline.be
  23. '- email: tvirus4ever@yahoo.co.uk
  24. '-
  25. '-----------------------------------
  26. If ExtractType <> 1 And ExtractType <> 2 Then Exit Function
  27. If Len(InputText) = Len(Replace(InputText, "\", "", 1, Len(InputText), vbTextCompare)) Then
  28. TvExtractT = InputText
  29. Exit Function
  30. End If
  31.  
  32. '--
  33. Dim X As String
  34. Dim p As Long
  35. '--
  36. '--
  37. p = ExtractType
  38. X = InputText
  39. '--
  40. '--
  41. Dim z As String
  42. Dim i As Long
  43. Dim t As String
  44. '--
  45. If p = 1 Then
  46. For i = Len(X) To 1 Step -1
  47. z = Mid$(X, i, 1)
  48. If z = "\" Then
  49. t = Right$(X, Len(X) - i)
  50. GoTo 10
  51. End If
  52. Next
  53. End If
  54.  
  55. If p = 2 Then
  56. For i = Len(X) To 1 Step -1
  57. z = Mid$(X, i, 1)
  58. If z = "\" Then
  59. t = Left$(X, i)
  60. GoTo 10
  61. End If
  62. Next
  63. End If
  64.  
  65. 10
  66. TvExtractT = t
  67. End Function
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.