Jump to content

Case Between Numbers


Recommended Posts

Hi Everyone

I have this:

Case $res = "05333520"
        $ans = "5"
        Case $res = "05333620"
        $ans = "5"
        Case $res = "05333610"
        $ans = "5"
        Case $res = "05333610"
        $ans = "5"
        Case $res = "05333640"
        $ans = "5"

How can you do a case between numbers so I dont have to make so many possibilities

ie.

Case $res = Between  05200000 & 05400000
 $ans = "5"

Thanks for help

Edited by eskermeko
Link to comment
Share on other sites

Thanks thats perfect.

Zedna gave you the best answer, I just wanted to point out that you can use boolean logic to get that comparison in other situations too:

If $res >= 05200000 And $res <= 05400000 Then MsgBox(0, "", "It's between!")

:shocked:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...