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 )

bullet.gif    sPath is the path name to abbreviate.

bullet.gif    nMaxChars is the maximum number of characters in the abbreviated name.

bullet.gif    sNewPath is the returned abbreviated path.

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


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.