Space after WinActive in #If-statemen

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Dest938572
Posts: 3
Joined: 28 Dec 2015, 06:02

Space after WinActive in #If-statemen

28 Nov 2019, 10:16

Why do this example works even if an active window is not notepad.exe?

Code: Select all

#If, WinActive ("ahk_exe notepad.exe")
F3::
	MsgBox, 12312121 
return
If I remove the space after the word "WinActive" it works properly.
Is it a feature or a bug?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Space after WinActive in #If-statemen

28 Nov 2019, 11:00

neither
WinActive is a blank variable in this case
the parens dont do anything in this case
the string is still a string in this case
nonempty(nonnumeric 0) strings still evaluate to true in expressions, in all cases
guest3456
Posts: 3469
Joined: 09 Oct 2013, 10:31

Re: Space after WinActive in #If-statemen

28 Nov 2019, 12:20

when both defining or calling a function, there must be no spaces between the function name and the open paren

also i'm not even sure if you should have the comma after the #if


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Mateusz53, MrHue, mstrauss2021, Rohwedder, Spawnova and 307 guests