Finally with function call with string concatenation Topic is solved

Report problems with documented functionality
2_05
Posts: 31
Joined: 09 May 2018, 10:28

Finally with function call with string concatenation

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.

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.
Last edited by 2_05 on 20 Jul 2023, 03:38, edited 1 time in total.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

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

11 Nov 2018, 02:16

v1.1.30.01 fixes this.

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

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 23 guests