See Also: File I/O Commands, File_Exist, Get_Directory, Make_Directory, Make_Temp_File, Remove_Directory, Valid_Drive
To return the path (among those listed in DF_OPEN_PATH) for a specified file.
Get_File_Path {file-name} to {variable}
sFileName the name of the file for which the path is to be returned.
variable a String variable to contain the path to sFileName.
The DFPATH (retrieve using the DF_OPEN_PATH attribute) value in the Registry is a list of folders that the system searches to find files. The Get_File_Path command searches the folders in the DFPATH key and returns the full path (including the file name) for the first occurrence of the file sFileName.
Procedure Test
String sPathHello sPathFileList sPathInvt
Get_File_Path "Hello.Txt" to sPathHello
Get_File_Path "Filelist.Cfg" to sPathFileList
Get_File_Path "Invt.Dat" to sPathInvt
Send Info_Box "Hello.Txt was found at " sPathHello
Send Info_Box "Filelist.Cfg was found at " sPathFileList
Send Info_Box "Invt.Dat was found at " sPathInvt
End_Procedure
If the file is not found, the return value is an empty string.