Page 1 of 1

Finally with function call with string concatenation

Posted: 31 Oct 2018, 12:28
by 2_05
I have trouble with a function I expect to return false in AhkVersion 1.1.30.00
The function has a finally statement with a function call concatenating a variable and a string.
Instead of false, the function returns the input value of the function call statement.
It seems to me like a bug as the workaround does work correctly.

Code: Select all

MsgBox, % some() ; Should display 0
MsgBox, % workaround() ; Displays 0

some()
{
	try
		return false
	finally
	{
		a := " window"
		somefunc("Some" a)
	}
}

somefunc(var)
{}

workaround()
{
	try
		return false
	finally
	{
		a := " window"
		b := "Some" a
		somefunc(b)
	}
}
Edit: fixed code block.
Edit2: Found that WinExist has nothing to do with it. Any function call in a finally statement with string concatenation triggers the bug.

Re: Finally with function call with string concatenation  Topic is solved

Posted: 11 Nov 2018, 02:16
by lexikos
v1.1.30.01 fixes this.

(Note that a parameter must be defined for somefunc() before the test code will run.)