Re: [AHK-] SplitPath 中文許功蓋問題

看板EzHotKey作者時間15年前 (2009/04/20 22:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
我發現之前的有點錯誤 所以又改了一下 - f_LastIsBackslash(Path) { if SubStr(Path, 0) = "\" ; if last is \ { StringTrimRight, Path, Path, 1 ; trim last \ Loop { if Path = return Mod(A_Index, 2) if Asc(SubStr(Path, 0)) < 128 ; if last char is not lead byte return Mod(A_Index, 2) ; if 1, last char is \ else StringTrimRight, Path, Path, 1 ; trim last, go to next char } } else return 0 } f_SplitPath(Path, ByRef FileName, ByRef Dir) { Temp = %Path% Loop { if f_LastIsBackslash(Temp) { FileNameLength := A_Index-1 break } else StringTrimRight, Temp, Temp, 1 ; trim last, go to next char } StringRight, FileName, Path, FileNameLength StringTrimRight, Dir, Path, FileNameLength+1 return } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.79.133
文章代碼(AID): #19x80xuR (EzHotKey)
文章代碼(AID): #19x80xuR (EzHotKey)