Functions in an if statement with AND

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Functions in an if statement with AND

13 Jun 2017, 22:01

Hi,

I'm pretty sure but I would like to confirm that, in the following example, FB will never ever get executed if FA returns false?

Code: Select all

if FA(1) and FB(2)
	MsgBox, true
return

FA(x)
{
	MsgBox, %x%
	return false
}

FB(x)
{
	MsgBox, %x%
	return true
}
Thanks.
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
User avatar
Cuadrix
Posts: 236
Joined: 07 May 2017, 08:26

Re: Functions in an if statement with AND

13 Jun 2017, 22:53

That's correct. It would have been another story if you used an OR.
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: Functions in an if statement with AND

13 Jun 2017, 23:03

Of course. Thanks for confirming.

Jean
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: Functions in an if statement with AND

14 Jun 2017, 08:05

Thanks for the reference to this very well done explanation. I should have search more.

BTW, this whole page worth read or re-read...
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 248 guests