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

Discuss the future of the AutoHotkey language
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

(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 RobertL on 10 Jun 2014, 09:54, edited 1 time in total.
我为人人,人人为己?
User avatar
fincs
Posts: 504
Joined: 30 Sep 2013, 14:17
GitHub: fincs
Location: Seville, Spain
Contact:

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

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 Development”

Who is online

Users browsing this forum: No registered users and 4 guests