홈 · 개발 참고자료

개발 참고자료

[파워빌더] Truncate a long path with ellipses

작성자
관리자
작성일
2016-10-22
조회
9250
분류
파워빌더
The PathCompactPathEx truncates a path to fit within a certain number of characters by replacing path components with ellipses.[local function declaration]
FUNCTION boolean PathCompactPathEx &
( REF String pszOut, string szPath, uint cchMax, long dwFlags) &
ALIAS FOR "PathCompactPathExA" &
LIBRARY "shlwapi.dll"


[powerscript]
String ls_longPath = &
"C:\Applications\Netscape\Netscape8\defaults\profile\chrome"

// 30 chars max plus a null
String ls_truncatedPath = space(31)

PathCompactPathEx(ls_truncatedPath, ls_longPath, 31, 0)

MessageBox(ls_longPath, ls_truncatedPath)

/*
Output :
---------------------------
C:\Applications\Netscape\Netscape8\defaults\profile\chrome
---------------------------
C:\Applications\Nets...\chrome
---------------------------
OK
---------------------------
*/