Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR() returns ALLCAPS filename, but we need mixed case
Message
 
To
11/05/2000 17:51:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00368834
Message ID:
00368848
Views:
15
>The filename returned from using the function ADIR() is in all caps. I want to save the filename returned to a VFP6 record exactly as it is capitalized in Windows Explorer. Is there a way to do this without using PROPER() since some of the words in the filename are not captialized.
>
>TIA

Here is how you do it with the scripting runtime that is installed with MS office 2000. I don't know if it is installed with anything else like IE5 or something or if there is a seperate installer that can be downloaded. All I know is that I have it on my machine because of Office 2000 and the following code works for me. Perhaps someone else can chime in about the differences between WSH (windows scripting host) and the scipting runtime and what needs to be distributed in order for code like this to work.

oFileSystem = createobject('scripting.filesystemobject')
oFile = oFileSystem.Getfile(somefile)
?ofile.name && returns the name of the file just like it is in explorer

"somefile" is the name of the file you are interesed in including all of it's path infomation. So you could use the results of your Adir() to load a variable like "somefile" and pass it to the getfile() method of the filesystem object
Rip Ryness
International Falls, MN
Previous
Reply
Map
View

Click here to load this message in the networking platform