*/***************************************************************************
*/Program : GetDos83
*/System : Project Bidding System
*/Purpose : return the dos8.3 filename of a file long file name
*/Syntax : dosname=GetDos83(WinName)
*/Returns : dosname - String - drive:\directory\filename
*/Parameter : WinName - String - drive:\directory\filename (May be blank)
*/Defaults : WinName = ""
*/Requires : path to Windows Win32API.dll
*/Changes : nothing
*/Calls :
*/Version : 1.0
*/Dated : 07/14/2000
*/Written By: John Durbin (From Tek-Tips VFP Forum)
*/ Accepts a path as a parameter.
*/ If the path is invalid or missing then GetFile gets one
*/ If you need a UI interface out of this then remove it
*/***************************************************************************
*& type of prg :
*/***************************************************************************
*/ Record Of Change
*/***************************************************************************
procedure GetDos83
lparameters tcLongPathName
local lcLongFile, lcBuffer, lnBufferSize, lnShortPathLen, lcShortPath
* Validate parameter
if empty(tcLongPathName) or vartype(tcLongPathName) <> 'C' or !file(tcLongPathName)
lcLongFile = getfile()
if !file(lcLongFile)
* user cancelled or again entered invalid stuff
return && Loser!
endif
else
* the path is valid
lcLongFile = tcLongPathName
endif
*
declare integer GetShortPathName in Win32API ;
string @lcLongPath, ;
string @lcShortPathBuff, ;
integer lnBuffSize
* should this be set to the maximum length allowed for a long path name?
lnBufferSize = 511
lcBuffer = space(511)
*
lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, @lnBufferSize)
lcShortPath = left(lcBuffer, lnShortPathLen)
return lcShortPath
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.