Modify

Opened 11 years ago

Closed 11 years ago

#2518 closed Bug (Fixed)

Static evaluates incorrect

Reported by: Taz77 <autoit@…> Owned by: Jon
Milestone: 3.3.9.23 Component: AutoIt
Version: 3.3.9.21 Severity: None
Keywords: static Cc:

Description

Func _Test()
	Return 7
EndFunc

Func _MyFirstFunc()
	Local Static $Test = _Test(), $FuncName = 'Dummy One'

	ConsoleWrite('FuncName is: ' & $FuncName & @CRLF)
EndFunc

Func _MySecendFunc()
	Local Static $Test = _Test(), $FuncName = 'Dummy Two'

	ConsoleWrite('FuncName is: ' & $FuncName & @CRLF)
EndFunc

_MyFirstFunc()
_MySecendFunc()

outputs:

FuncName is: Dummy One
FuncName is: Dummy One

properly it would be:

FuncName is: Dummy One
FuncName is: Dummy Two

Forum Link

Change History (5)

comment:1 follow-up: Changed 11 years ago by Jpm

  • Resolution set to Duplicate
  • Status changed from new to closed

Already fixed in 3.3.9.22

comment:2 in reply to: ↑ 1 Changed 11 years ago by Taz77 <autoit@…>

Replying to Jpm:

Already fixed in 3.3.9.22


is NOT fixed in 3.3.9.22 Forum Link

Func _Test()
	Return 7
EndFunc

Func _Func_A()
	Local Static $Test = _Test(), $String = 'This is a string.'
	ConsoleWrite('_Func_A() string is: ' & $String & @CRLF)
EndFunc

Func _Func_B()
	Local Static $Test = _Test(), $String = 'and this is another string.'
	ConsoleWrite('_Func_B() string is: ' & $String & @CRLF)
EndFunc

_Func_A()
_Func_B()

the output is:

_Func_A() string is: This is a string.
_Func_B() string is: This is a string.

but so it would be correct:

_Func_A() string is: This is a string.
_Func_B() string is: and this is another string.

comment:3 Changed 11 years ago by Jpm

  • Resolution Duplicate deleted
  • Status changed from closed to reopened

I am sorry in my local dev environment (uppose to be in sync with the next beta)

it works fine, that's the reason I close it.

I ned now to find out why !!!

comment:4 Changed 11 years ago by Jpm

You will not believe the fix I proposed to Jon for #2372 is fixing this one too.
The only problem is Jon does not like it.
Wait and see

Last edited 11 years ago by Jpm (previous) (diff)

comment:5 Changed 11 years ago by Jon

  • Milestone set to 3.3.9.23
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from reopened to closed

Fixed by revision [9179] in version: 3.3.9.23

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.