Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETFILE() - all caps only?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00818089
Message ID:
00818104
Views:
25
Henry,
Interestingly enough ADir() does return the correct case. So I use that to correct the case after a file or directory has been selected.
Function ProperCase
Lparameters lcItem
Local lcReturn

lcReturn = This.CorrectCase(lcItem)
lcItem = JustPath(lcItem)
DO while !Empty(lcItem)
	lcReturn = Addbs(This.CorrectCase(lcItem)) + lcReturn
	If lcItem == JustPath(lcItem)
		lcItem = ""
	Else
		lcItem = JustPath(lcItem)
	EndIf
EndDo
Return lcReturn

Function CorrectCase
Lparameters lcItem
Local laInfo[1], lnFound, lcReturn

lnFound = ADir(laInfo, lcItem, "D", 1)
DO case
	Case lnFound = 0
		*-- This is the Drive letter ie D:\
		lcReturn = lcItem
	Case lnFound = 1
		*-- This is a file name or a portion of the path.
		lcReturn = laInfo[1,1]
	Case lnFound = 2 and laInfo[1,1]="."
		*-- This is a directory name.
		lcReturn = ""
	Otherwise
		lcReturn = laInfo[1,1]
EndCase
Return lcReturn
HTH
Caroline

>Is there any way to stop GETFILE() from returning a string that is not automatically converted to all capital letters? I don't see any way to do this mentioned in the Help files for VFP 6, 7 or 8.
>
>What are the other options, if any? Windows Scripting Host, maybe?
>Thanks in advance.
>
>Henry
Caroline
Previous
Reply
Map
View

Click here to load this message in the networking platform