FoxPro JustExt() function

The VFP JustExt() function returns the extension from a string containing a file name. For example:

JustExt ("vfp9.exe")

would return:

"exe"

If the file has no extension, or if the file name just ends in a period, then an empty string will be returned.

As with JustDrive(), JustExt() does not look at the file system or check that the parameter is a properly formed name or path. All that it does is look for the final period in a string and return the characters that follow it.

Note that this implies that the function will return the final extension from a file name that includes two periods and two extensions.

VBA equivalent

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

MS Access technical tips

Visual FoxPro technical tips

General Tips

 

More tips from Alvechurch Data

FoxPro Functions

FoxPro has always had functions like FREAD and FWRITE to read and write files at a low level. They can handle files which defeat the STRTOFILE and FILETOSTR functions.

Read More

FoxPro DefaultExt function

FoxPro functions to manipulate names of files and folders

Read More

FoxPro ForceExt function

FoxPro functions to manipulate names of files and folders

Read More

FoxPro ForcePath function

FoxPro functions to manipulate names of files and folders

Read More

FoxPro JustFName function

FoxPro functions to manipulate names of files and folders

Read More