Sign in to follow this  
Followers 0
eskermeko

Case Between Numbers

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks thats perfect.

Edited by eskermeko

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0