If AND Statements for multiple variables Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Yourmotor
Posts: 3
Joined: 04 Feb 2020, 12:25

If AND Statements for multiple variables

04 Feb 2020, 12:49

A_AhkVersion = 1.1.30.03

For some reason the following code is not returning true. How should I write this to make it work?

Code: Select all

F6::
vAA := 1 , vBB := 3
vAB := vAA
vBC := vBB
If (vAB = %vAA%) && (vBC = %vBB%)
	Msgbox , 0 ,,  cool , 1
else
	Msgbox , 0 ,,  fail , 1
Return
Gibbons
Posts: 93
Joined: 20 Sep 2016, 20:39

Re: If AND Statements for multiple variables  Topic is solved

04 Feb 2020, 12:53

Variables in expressions (var) do not need the %var% format

Code: Select all

F6::
vAA := 1 , vBB := 3
vAB := vAA
vBC := vBB
If (vAB = vAA) && (vBC = vBB)
	Msgbox , 0 ,,  cool , 1
else
	Msgbox , 0 ,,  fail , 1
Return
Last edited by Gibbons on 04 Feb 2020, 12:55, edited 1 time in total.
Yourmotor
Posts: 3
Joined: 04 Feb 2020, 12:25

Re: If AND Statements for multiple variables

04 Feb 2020, 12:55

Can't believe I didn't try that. I was thinking way too hard about it. Thank you!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, peter_ahk and 412 guests