Multiple If Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

Multiple If

19 Oct 2017, 07:59

How can I use multiple If?
I've tried the following code and it doesn't work

Code: Select all

A = 5
B = 66
if A between 5 and 8 && if B between 50 and 100
	MsgBox Ok.
User avatar
Spawnova
Posts: 557
Joined: 08 Jul 2015, 00:12
Contact:

Re: Multiple If  Topic is solved

19 Oct 2017, 08:05

Code: Select all

a := 5
b := 66
if ((a >= 5 and a <= 8) and (b >= 50 and b <= 100)) {
	msgbox a is between 5 and 8`nb is bewteen 50 and 100
}
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

Re: Multiple If

19 Oct 2017, 08:10

Thank you mate.
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Multiple If

19 Oct 2017, 08:16

Using the format you originally tried:

Code: Select all

#SingleInstance, Force
    
A := 5
B := 66

If A between 5 and 8
{
    If B between 50 and 100
    {
        MsgBox, OK
    }
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Rohwedder and 143 guests