Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DOS Compliant Folder names
Message
De
22/04/2005 12:00:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01007482
Message ID:
01007501
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>This is a good one.
>
>In VFP 7 when you used Getdir() it would return a DOS compliant folder name something like C:\DOCUME~1\MARK\LOCALS~1\TEMP
>
>In 9 if the original directory name is DOS compliant it will use ~ and stuff until you go to the root, then it will return the full folder name with spaces and stuff.
>
>I have an application that was written in 7 or earlier, there are quite a few places where I will have to go and put quotes around variables.
>
>I would prefer not to do this. Do y’all know of a way to get a DOS compliant folder name from one with the spaces and stuff, and vice versa.
>
>For example:
>C:\Program Files\ApplicationDir to c:\Progra~1\Applic~1 and back.
>
>I'm just guessing on how the translation is actually done.
>
>TIA
? GetShort(getfile())

function GetShort
lparameters cFileName
declare integer GetShortPathName  in Win32API ;
    string @lpszLongPath,	;
    string @lpszShortPath,	;
    integer  cchBuffer

lpszShortPath = space(len(cFileName))
lnPathlen = GetShortPathName(@cFileName, @lpszShortPath, len(cFileName))
if lnPathlen > 0
	return substr(lpszShortPath, 1, lnPathLen)
endif
return ""
However you don't need it.
lcFile = getfile()
*do whatever with (m.lcFile) && ie: use (m.lcFile)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform