Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ

Program Source Code

Legal Dos 8.3 filename in from Windows by dgrewe
Posted: 11 Oct 00

*/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!
  * the path is valid
  lcLongFile = tcLongPathName
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

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close