Call with: lcShortFilename = getShortFilename('D:\COMP JAIPUR\20131106_20131101\100042\1005753165.Pdf') ? "Short filename: " + lcShortFilename And also lcShortFilename = getShortFilename('D:\COMP JAIPUR\20131106_20131101\100042\1005753165.Pdf'@llIsValid) ? "Short filename: " + lcShortFilenameBut got errors. Please Explain the usage with Example in my case
gswin32c.exe -sDEVICE="pdfwrite" -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -dSAFER -dQUIET -sOUTPUTFILE=D:\COMP JAIPUR\20131106_20131101\100042\1001817119.Pdf D:\COMP JAIPUR\20131106_20131101\100042\1001817119.ps>
* Call with: >* lcShortFilename = getShortFilename(lcLongFilename, @llIsValid >* IF llIsValid >* ? "Short filename: " + lcShortFilename >* ELSE >* ? "Unable to determine short filename from: " + lcLongFilename >* ENDIF >FUNCTION getShortFilename >PARAMETERS pcLongFilename, plValid >LOCAL lcShortFilename, lnShortFilenameLength, lnReturnValue > > #DEFINE MAX_PATH 255 > DECLARE INTEGER GetShortPathName IN Kernel32 STRING @lpszLongPath, STRING @lpszShortPath, INTEGER cchBuffer > DECLARE INTEGER GetLastError IN Win32api > > IF EMPTY(pcLongFilename) > pcLongFilename = FULLPATH(CURDIR()) > ENDIF > > * buffer to receive converted file name > lcShortFilename = SPACE(MAX_PATH) > lnShortFilenameLength = LEN(lcShortFilename) > > * if successful, lnReturnValue will contain the length of the output string > lnReturnValue = GetShortPathName(@pcLongFilename, @lcShortFilename, lnShortFilenameLength) > IF lnReturnValue = 0 > plValid = .F. > RETURN "?? Unable to get the short path" > ENDIF > plValid = .T. > > * truncate it at the length the return value indicates > RETURN LEFT(lcShortFilename, lnReturnValue) >>