Maptitude GISDK Help |
Shortens a file's pathname to the listed length for purposes of display.
Added to Version 2019.
CompactPath(string path, integer length)
Argument |
Contents |
path |
Full file pathname of a file |
length |
Shortened string length |
The pathname no longer than length.
CompactPath() replaces a part of the pathname with an ellipsis so that it can be used, for example, to get a short display name that fits into a smaller space in a dialog box.
Unlike GetShortPathName(), CompactPath() returns a pathname that cannot be used to refer to the file.
folder = RunMacro("G30 Tutorial Folder")
file_name = folder + "customer.dbf"
compact_name = CompactPath(file_name, 20)
ShowMessage("The compact pathname for " + file_name + " is " + compact_name)
result = CompactPath("C:\\this\\is\\a\\long\\path.exe", 10)
// result = "...\\path.exe"
Function |
Summary |
Converts a relative pathname to an absolute pathname |
|
Returns the full, long pathname for a file |
|
Converts an absolute pathname to a relative pathname |
|
Returns the short pathname for a file |
|
Tests to see if the pathname is an absolute pathname |
|
Splits a path and filename into its component parts |
©2025 Caliper Corporation | www.caliper.com |