Functions in an if statement with AND

Get help with using AutoHotkey and its commands and hotkeys
User avatar
JnLlnd
Posts: 289
Joined: 29 Sep 2013, 21:29
GitHub: JnLlnd
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.
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
Cuadrix
Posts: 199
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: 289
Joined: 29 Sep 2013, 21:29
GitHub: JnLlnd
Location: Montreal, Quebec, Canada
Contact:

Re: Functions in an if statement with AND

13 Jun 2017, 23:03

Of course. Thanks for confirming.

Jean
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
JnLlnd
Posts: 289
Joined: 29 Sep 2013, 21:29
GitHub: JnLlnd
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...
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Frosti and 152 guests