Visual FoxPro functions for file names

The FoxPro programming language has a wide range of text-handling functions but there are also nine functions which are specifically designed for working with file and path names. All were originally part of the FoxPro Link Library, foxtools.fll, in earlier versions of Foxpro but have now been added to the language as functions.

These functions are described below:

  • AddBS() adds a backslash to a path if the path does not already end in a backslash.
  • DefaultExt() adds a default extension if the file lacks an extension.
  • ForceExt() gives the file a new extension - replacing any existing extension.
  • ForcePath() gives the file a new path repacing any existing path.
  • JustDrive() returns the drive letter from a path.
  • JustExt() returns the extension of a file.
  • JustFName() returns the name of a file - including the extension.
  • JustPath() returns the path to a file.
  • JustStem() returns the stem of a filename without the extension.

VBA equivalent

Microsoft Access does not have equivalents to these FoxPro file name commands so I wrote this library of Visual Basic functions to give me the same facilities in VBA.