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

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
RobertL
Posts: 546
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: 527
Joined: 30 Sep 2013, 14:17
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 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 - [My project list]
User avatar
RobertL
Posts: 546
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 “Ask for Help (v2)”

Who is online

Users browsing this forum: Albireo, hemps, hisrRB57, Stpham and 36 guests