home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Tutorial_M46439152002.psc / modFunctions.bas < prev    next >
Encoding:
BASIC Source File  |  2002-01-04  |  733 b   |  30 lines

  1. Attribute VB_Name = "modFunctions"
  2. Public Function GetFileNameFromPath(strPath) As String
  3.   Dim intX As Integer
  4.   Dim intPlace As Integer
  5.   Dim intLastPlace As Integer
  6.     
  7.   intLastPlace = 0
  8.  
  9.   For intX = 1 To Len(strPath)
  10.     intPlace = InStr(intLastPlace + 1, strPath, "\")
  11.     
  12.     If intPlace = 0 Then
  13.       GetFileNameFromPath = Right(strPath, Len(strPath) - intLastPlace)
  14.       Exit Function
  15.     Else
  16.       intLastPlace = intPlace
  17.     End If
  18.   Next intX
  19. End Function
  20.  
  21. Public Function FileExist(ByVal FileName As String) As Boolean
  22. 'Determines if a file exists
  23. On Error Resume Next
  24. If Dir(FileName, vbSystem + vbHidden) = "" Then
  25.     FileExist = False
  26. Else
  27.     FileExist = True
  28. End If
  29. End Function
  30.