Jump to content

Count down in For...Next loop?


Go to solution Solved by Andreik,

Recommended Posts

This should be obvious, but I can't find the answer anywhere. I have a For...Next routine that counts from ASCII 65 to 90 to find free drive letters, starting with A: and ending with Z: Is there a way to make it count down from 90 to 65, so it will start with Z:?? This is the code I use:

For $x = 65 To 90
        If DriveStatus(Chr($x) & ':\') = 'INVALID' Then
            $firstFree = (Chr($x) & ':')
            ExitLoop
        EndIf
Next

Thanks for any advice. Again, I think the answer should be obvious, but it isn't obvious to me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...