Select Drive

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Samio
    Forum Member
    • Nov 2006
    • 191

    Select Drive

    Hi.
    I Make a Select Drive Screen.
    I Want To Get And Show All Fixed Drive To The Select Drive Screen Combox
    And Select "Drive E:" Automaticly if E is Fixed.
    please help me.it is very important and fast.
  • Jason Pate
    Forum Member
    • Jan 2002
    • 328

    #2
    This is sample code of AM6 same LUA as SF7 it should help you with a little modification you can just test for type and if the drive letter is = to "E"

    Code:
    -- Get a list of all drives in the user's system
    drives = Drive.Enumerate();
    
    -- Step through the returned list
    for j in drives do
       -- Get the type of the drive
        type = Drive.GetType(drives[j]);
    
       -- Check if the type of drive is fixed
        if type == 3 then
           -- It is fixed, note the drive letter and break out of the loop
            first_hdd = drives[j];
           break;
        end
    end
    
    -- Output result to the user
    Dialog.Message("", "The user's main HDD is "..first_hdd);

    Comment

    Working...
    X