Purpose
Returns only the specified file's directory. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
PathToDirectory$( filespec )
filespec is a string expression representing a full file specification.
Return Value
String
Description
The PathToDirectory$() function returns just the "directory" component from a full file specification.
A full file specification can include a directory and a filename. The file specification C:\MAPINFO\DATA\WORLD.TAB includes the directory "C:\MAPINFO\DATA\".
Example
Dim s_filespec, s_filedir As String
s_filespec = "C:\MAPINFO\DATA\STATES.TAB"
s_filedir = PathToDirectory$(s_filespec)
' s_filedir now contains the string "C:\MAPINFO\DATA\"
See Also:
PathToFileName$() function, PathToTableName$() function