V2 Switch error Topic is solved

Report problems with documented functionality
SAbboushi
Posts: 252
Joined: 08 Dec 2014, 22:13

V2 Switch error

19 Mar 2020, 16:14

Code: Select all

^+F8::
			Switch A_ThisHotkey ; results in Exit code: 3221225477
			{
				case 1:
					MsgBox 1
				Default:
					MsgBox 2
			}
v2.0-a107-03296ce9
User avatar
kczx3
Posts: 1649
Joined: 06 Oct 2015, 21:39

Re: V2 Switch error

19 Mar 2020, 19:06

First, I’d recommend using the latest version to report possible bugs. Second, does it work if you first assign A_ThisHotkey to another variable and use that in the Switch?
SAbboushi
Posts: 252
Joined: 08 Dec 2014, 22:13

Re: V2 Switch error

19 Mar 2020, 21:43

>> does it work if you first assign A_ThisHotkey to another variable and use that in the Switch?
Yes that works fine
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: V2 Switch error

19 Mar 2020, 23:12

I confirmed the bug in the latest V2:
2.0-a108-a2fa0498 (64-bit)

Also, note that the bug does not exist in the latest V1:
1.1.32.00 (64-bit Unicode)

Regards, Joe
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

Re: V2 Switch error

13 Apr 2020, 09:25

Test with AutoHotkey_2.0-a108-a2fa0498

Code: Select all

F8::
	A_TH:= A_ThisHotkey
	MsgBox(A_ThisHotkey)
	if A_ThisHotkey == 'F8'
		MsgBox(A_ThisHotkey)
		
	try Switch A_TH ;<< OK
	{
		case 'F8': MsgBox 1
		Default: MsgBox 2
	}
	catch e
		MsgBox e.Message
		
	try Switch A_ThisHotkey ;<< crashed
	{
		case 'F8': MsgBox 1
		Default: MsgBox 2
	}
	catch e
		MsgBox e.Message
AHKv2.0 alpha forever.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 29 guests