Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine local drive letter?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00259820
Message ID:
00259883
Views:
18
>>>I am working on a small app that is to reside on a network. When the user runs the app, they select the types of information they need and based on this various tables and other files are to be copied to a directory on the users local drive. How do I determine what the local drive letter is?
>>
>>Hi Colin,
>>
>>Well, it depends on which version of VFP you're running. In 6.0 DRIVETYPE() was added to the language. Previously, the same function is in Foxtools. You can either loop through and check each drive letter to see if it's a local hard drive, or use an API call (either GetLogicalDrives() or GetLogicalDriveStrings()) to get the valid drive letters.
>
>Thanks George. I do have VFP 6. I am looping through A to Z using DRIVETYPE() function and when it returns 3 using DIRECTORY() funtion to see if valid directory exists. If so, I've got the drive letter needed. Works great. Thanx again.

You're welcome, Colin. Glad to be of help.

BTW, SYS(5) returns the current default directory (which, depending on circumstances) may or may not return the network drive if that's where the app is located.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform