&& True

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hemsith14_
Posts: 296
Joined: 07 Nov 2020, 08:37

&& True

Post by hemsith14_ » 22 May 2022, 09:44

Hey,
How do I write correctly something like:

Code: Select all

If !WinActive("ahk_class Window") && MyStatement := True
{
do something
}
Thanks for your help!

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: && True

Post by boiler » 22 May 2022, 09:49

You don't need a comparison to True. Expressions/conditions are already evaluated as true or false, and comparing it to true is redundant. Plus, you wouldn't use the assignment operator := or comparison, you would use =.

Code: Select all

If !WinActive("ahk_class Window") && MyStatement
{
do something
}

Post Reply

Return to “Ask for Help (v1)”