Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper Case File Names vs. ADIR()
Message
From
05/11/1997 19:06:29
 
 
To
05/11/1997 16:29:26
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00058492
Message ID:
00058514
Views:
31
>Does anyone know an easy way yo use the APIs to retrieve file names in their "true" case (upper and lower, the same way we see them in Windows Explorer)? I want essentially the functionality that ADIR() achieves, but that VFP function returns all upper case.
>
>TIA,
>
>-- Randy


Why don't you convert the names after you run the ADIR
LOCAL lnTotFiles, lnCurr, lcFile, lnPos

DECLARE aProper[1]
lnTotFiles =ADIR( aFiles )
DIMENSION aProper[ lnTotFiles ]

FOR lnCurr = 1 to lnTotFiles
lcFile = aFiles[lnCurr,1]

* strip the extension
lnPos = AT( ".", lcFile )
lcFile = IIF( lnPos # 0, SUBS( lcFile, 1, lnPos-1 ), lcFile )

aProper[ lnCurr ] = lcFile
ENDFOR

RELEASE aFiles
Previous
Reply
Map
View

Click here to load this message in the networking platform