[My fault | Close]expression+comma+traditional assignment

Report problems with documented functionality
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

[My fault | Close]expression+comma+traditional assignment

27 Aug 2014, 23:12

Variables and Expressions wrote:Storing values in variables: To store a string or number in a variable, there are two methods: traditional and expression.
AHK_L V1.1.15

Code: Select all

a:="1",b="2"
,c="3"
d="4"
MsgBox % a "," b "," c "," d	;1,2,3,"4"
return
Shouldn't b / c be "2" / "3" (like d "4")?
Last edited by RobertL on 28 Aug 2014, 00:11, edited 1 time in total.
我为人人,人人为己?
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Error, traditional assignment after comma follow express

27 Aug 2014, 23:51

The error is yours only. You cannot use a "traditional" assignment in an expression.
Expressions - comma wrote:In v1.0.46.01+, when a comma is followed immediately by a variable and an equal sign, that equal sign is automatically treated as an assignment (:=). For example, all of the following are assignments: x:=1, y=2, a=b=c.
This does not apply to v2.
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: [My fault | Close]expression+comma+traditional assignmen

28 Aug 2014, 00:17

Sorry, I'm muddled.
I mostly use V2, in some test, I change expression assignment to traditional.
我为人人,人人为己?

Return to “Bug Reports”

Who is online

Users browsing this forum: niCode and 72 guests