Finally with function call with string concatenation
Posted: 31 Oct 2018, 12:28
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.
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.
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)
}
}
Edit2: Found that WinExist has nothing to do with it. Any function call in a finally statement with string concatenation triggers the bug.