The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_filesys
Class: none
Declaration: function AbridgeFilePath (Path: string; MaxLength: integer): string;

Beginning at the left side of Path the function AbridgeFilePath successively replaces parts of the file path between two (back)slashes by two dots until the length of the path is less than MaxLength (or there is nothing left to be replaced). The filename (the partial string after the last (back)slash) is retained in any case.

AbridgeFilePath automatically detects whether the file path uses slashes or backslashes for the separation of directories. Thus unix-style pathes may be processed, as well. A mixture of slashes and backslashes is not allowed.

Example: The statement AbridgeFilePath ('h:\minitab14\data\meet_minitab\test.mtw', 32); returns the string 'h:\..\..\meet_minitab\test.mtw'.

Last Update: 2016-May-10