Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy to usb
Message
From
07/04/2005 08:26:08
 
 
To
07/04/2005 07:53:35
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01002192
Message ID:
01002214
Views:
31
>I'm curious about this too. How would you make it generic though. The drive letters could change for a USB device.
>
>>The USB device should have a drive letter assigned to it. Just copy the folder to the drive letter, (IE L:\).

You can use GetDriveType API function. It reports USB drives as removable. I suppose (I HOPE) Windows assign a letter different then "A" or "B" for them (If you have no floppy drive"
? GetUSBDrive() && The function name is not correct, because you can have ZIP drive or other types of removable drives

FUNCTION GetUSBDrive()

   LOCAL nDrives, ret_val, cDrive
   ret_val = ""
   DECLARE INTEGER GetDriveType IN Win32API STRING DriveName
   FOR nDrives = 67 TO 90 && Just not check for "A" or "B" 
	cDrive = CHR(nDrives)+":\"+CHR(0)
        IF GetDriveType(cDrive) = 2 && Removable
           ret_val = ret_val + IIF(EMPTY(ret_val),"",CHR(13)+CHR(10)) + CHR(nDrives)
        ENDIF
    NEXT

RETURN m.ret_val
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform