blank parameter followed by &var Topic is solved

Discuss the future of the AutoHotkey language
User avatar
Posts: 5435
Joined: 19 Dec 2016, 01:58
Location: UK

blank parameter followed by &var

10 Feb 2018, 11:56

I was testing script conversion, and got a 'Syntax error' error message with AHK v2.0-a088 (the latest version), when a blank parameter was followed by a parameter of the form '&var'. Although I have found some workarounds.

Code: Select all

q:: ;test blank parameter followed by '&var'
hCtl := ControlGetHwnd("Edit1", "A")
vText := "abcde"

;SendMessage(0xC,, &vText,, "ahk_id " hCtl) ;WM_SETTEXT := 0xC ;doesn't work
;SendMessage(0xC, "", &vText,, "ahk_id " hCtl) ;WM_SETTEXT := 0xC ;works
;SendMessage(0xC,, 0+&vText,, "ahk_id " hCtl) ;WM_SETTEXT := 0xC ;works

;MyFunc(,,,,, &vText) ;doesn't work
;MyFunc(,,,, "", &vText) ;works
MyFunc(,,,,, 0+&vText) ;works

Posts: 3303
Joined: 17 Jul 2016, 01:02

Re: blank parameter followed by &var

10 Feb 2018, 13:38

Look like a parsing error. Another workaround for sendMessage, just omit the & ;)

Posts: 6207
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: blank parameter followed by &var  Topic is solved

26 Mar 2018, 04:57

This was fixed in v2.0-a089.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 3 guests