Assert

AbbrevPath


The AbbrevPath function returns a string that is an abbreviated form of a file path. The returned string is no longer than a specified number of characters. The original name is unchanged.

Syntax

sNewPath = AbbrevPath( sPath, nMaxChars )

Example

Suppose a file has the path name 'C:\My Folder\My File.txt'. Then

s = C:\My Folder\My File.txt

-- open the file as text, for read and write

Printf( "'%s'", s )

-- prints 'C:\My Folder\My File.txt'

Printf( "'%s'", AbbrevPath(s,20) )

-- prints 'C:\...\My File.txt'

Related Topics

CImage:Path, CSplitpath