Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper Case File Names vs. ADIR()
Message
De
05/11/1997 19:06:29
 
 
À
05/11/1997 16:29:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00058492
Message ID:
00058514
Vues:
38
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform