Visual Basic Core Snippet Routines
QualifyPath
          
                 
   Appends a trailing slash to a path if required to create a fully-qualified path.     
           Updated:   Monday December 26, 2011   
click to copy code:  


   Applies to:   VB4-32, VB5, VB6   
OS restrictions:   None  
 Code Snippet
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce 
'               or publish this code on any web site,
'               online service, or distribute as source 
'               on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Function QualifyPath(sPath As String) As String
 
   If Len(sPath) > 0 Then
 
      If Right$(sPath, 1) <> "\" Then
         QualifyPath = sPath & "\"
      Else
         QualifyPath = sPath
      End If
   Else
      QualifyPath = ""
   End If
   
End Function

 Calling Syntax
   sQualifiedPath = QualifyPath(sPath)

 Comments / Related
demo in use:  FindFirstFile: Changing File and/or Folder Attributes Recursively
FindFirstFile: Recursive File Search (minimal code)
FindFirstFile: Recursive Search for Folders (minimal code)
FindFirstFile: Recursive File Search for Single or Multiple File Types (minimal code)
FindFirstFile: Recursive File Search Including/Excluding Single or Multiple File Types (minimal code)
FindFirstFile: Recursive Search for Folders Using a Folder Mask (minimal code)
FindFirstFile: Calculating Folder Size, Recursive
FindFirstFile: Performance Comparison - FSO vs. API
FindFirstFile: Comparison of FindFirstFile and SearchTreeForFile
FindFirstFile: Save a Recursive Search of All Drives to Disk
FindFirstFile: Save a Recursive Search of Specified Drives to Disk
GetFileVersionInfo: File Search and File Property Info
CopyFileEx: Create a File Backup App
CopyFileEx: Create a File Backup App with a Progress Callback
ExtractIcon: Viewing Application Icons in a Scrollable Viewport
   
Related:   UnQualifyPath

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright ©1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter