[Solved]Can't use expression in SendMessage's arg Msg Topic is solved

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
User avatar
RobertL
Posts: 540
Joined: 18 Jan 2014, 01:14
Location: China

[Solved]Can't use expression in SendMessage's arg Msg

10 Jun 2014, 08:27

[Update by Lexikos: Legacy syntax was removed in v2.0-a079.]

(At least,) Command SendMessage's first arg Msg doesn't support expression in AHK V2.
So

Code: Select all

x:=12,
SendMessage x,..        ;don't work
SendMessage % x,..    ;could work
Last edited by lexikos on 19 Jun 2020, 18:36, edited 2 times in total.
Reason: update
我为人人,人人为己?
User avatar
fincs
Posts: 505
Joined: 30 Sep 2013, 14:17
GitHub: fincs
Location: Seville, Spain
Contact:

Re: [BUG]Can't use expression in SendMessage's arg Msg (AHK   Topic is solved

10 Jun 2014, 09:16

This is intentional, and for consistency purposes. Please use force-expression mode or actual expression syntax to call SendMessage.
v2-changes wrote:Command args are never expressions by default, except with control flow statements such as Return. The % (percent followed by space) prefix can still be used to force an expression.
fincs
Windows 10 x64 Build 18362 | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v1.1.31.01
Get SciTE4AutoHotkey v3.0.06.01 - [My project list]
User avatar
RobertL
Posts: 540
Joined: 18 Jan 2014, 01:14
Location: China

Re: [BUG]Can't use expression in SendMessage's arg Msg (AHK

10 Jun 2014, 09:53

Oh, sorry, I forget it. I just only searched for "SendMessage" in "Changes from v1.1 to v2.0".
Or Command called as functions——Command().
我为人人,人人为己?

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 4 guests