[2.1-alpha.8] Static variables can't be initialized as unset

Report problems with documented functionality
niCode
Posts: 316
Joined: 17 Oct 2022, 22:09

[2.1-alpha.8] Static variables can't be initialized as unset

23 Dec 2023, 03:15

This has been happening since at least alpha-7. I haven't tested any alphas prior to that.

Example:

Code: Select all

; Error: This statement's parameters cannot be unset.
MyFunc()
{
    static var := unset
    var := 'something'
    MsgBox(var)
}
This works on the stable versions. I haven't seen anything to indicate this has been changed either here or in the built-in documentation (that includes alpha changes).
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

Re: [2.1-alpha.8] Static variables can't be initialized as unset

24 Dec 2023, 23:49

c:=&var:=(x?) also cannot work after alpha.2
lexikos
Posts: 9678
Joined: 30 Sep 2013, 04:07
Contact:

Re: [2.1-alpha.8] Static variables can't be initialized as unset

19 Jan 2024, 07:32

@niCode While this is a bug, it would be more efficient (typing and execution) to omit := unset in that example.

Spoiler

@V2User That is unrelated, and the code works correctly in v2.1-alpha.8.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 12 guests