Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining valid drives
Message
From
08/12/2006 15:21:11
 
 
To
08/12/2006 13:38:36
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01176193
Message ID:
01176244
Views:
12
>Hi all,
>
>I want to set something up on a form that will allow the user to select from a list of valid drives on the system (C:, F:, etc.). I'd like to do this with a listbox or a spinner.
>
>How can I determine what the valid drives would be? Once that's determined, how do I get a list of the valid folders on that drive?
>
>Thanks!
>
>John

and, yet, another way is...
    PROCEDURE Logical_Drives_list()

        DECLARE INTEGER GetLogicalDriveStrings IN kernel32;
            INTEGER  nBufferLength,;
            STRING @ lpBuffer

        LOCAL lcDrives
        lcDrives = SPACE(255)

        GetLogicalDriveStrings( LEN(lcDrives), @lcDrives )

        lcDrives = ALLTRIM(STRTRAN(lcDrives,CHR(0),CHR(13)+CHR(10)))

        RETURN lcDrives
    ENDPROC
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform