﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
530	HotKeySet ignores optional parameters	danerjones@…		"After executing this function:
{{{
HotKeySet(""{ESC}"", ""QuitApp"")

Func QuitApp($Quick = False)
	
	If $Quick Then
		Exit
	EndIf
	
	_FinishUp()
	Exit
EndFunc
}}}

The following Error was returned.
{{{
>Running:(3.2.12.1):C:\Program Files\AutoIt3\autoit3.exe ""C:\Script.au3""    
C:\Script.au3 (457) : ==> Variable used without being declared.:
If $Quick Then
If ^ ERROR
}}}

It appears that when {ESC} is pressed, the optional parameter is not properly defined causing the error.

This issue only occurs when the function is triggered from HotKeySet and an optional parameter is declared.

I have rewritten the function to work around the issue for the time being.

{{{
HotKeySet(""{ESC}"", ""QuitApp"")

Func QuitApp($Quick = False)
	
	If IsDeclared(""Quick"") Then 
		If $Quick Then Exit
	EndIf
	
	_FinishUp()
	Exit
EndFunc
}}}"	Bug	closed		AutoIt	Other	None	No Bug	HotKeySet,457,optional parameter	
