Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR() Mixed case please...
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00436894
Message ID:
00437301
Vues:
21
>>>ADIR() returns an array with the files in a directory, but all the filenames are uppercase. Is it possible to get an list of the files in a directory as they are shown in windows explorer (MixedCase)????

If filtering is essenstial, then you could use Filer.DLL (not distributable) - I do not know what the maximum number of files is, but masks can be specified in addition to three search strings, sub-folders, ignore case, etc.
#define FILE_ATTRIBUTE_DIRECTORY            0x00000010  

LPARAMETERS cFileSpec

oFiler = CREATEOBJECT( "Filer.FileUtil" )

WITH oFiler
	.SearchPath = JUSTPATH( cFileSpec )
	.FileExpression = "*.*"
	.Find( 0 )	&& Search, discarding last collection.
	FOR iFile = 1 TO .Files.Count
		IF .Files.Item(iFile).Attr = FILE_ATTRIBUTE_DIRECTORY ;
			OR .Files.Item(iFile).Name == "." ;
			OR .Files.Item(iFile).Name == ".."
			? " DIR "
		ELSE
			? "     "
		ENDIF
		?? .Files.Item(iFile).Name
	NEXT iFile
ENDWITH
censored.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform