>DECLARE INTEGER GetShortPathName IN Win32API ; > STRING @cLongPath, ; > STRING @cShortPathBuff, ; > INTEGER nBuffSize > >lcLongFile = "c:\program files\somefolder\my file name.doc" >lcBuffer = SPACE(511) >lnBufferSize = 511 >lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, @lnBufferSize) > >lcShortPath = LEFT(lcBuffer, lnBufferSize) > >I realize this is an old thread, but for the record, please note that the last line of Eric's example should read:
lcShortPath = LEFT(lcBuffer, lnShortPathLen)
Update: also I believe the last argument to GetShortPathName should not be passed by reference, and the declaration of the first argument doesn't seem to call for an "@", because this is a constant string (input). Only the second string argument is an output value. (I'm not sure if the use of @ on a string argument is really significant, except as a convention.)