my 10k+ lines script, written for v2-a100, yields lotta errors and unexpected behavior with v2-a108 so I started reading the official manual from the scratch.
And found quite a few typos/redundant stuff/errors (the post will be updated if I find more).
1.
Code: Select all
class class1{
static func1(){
t:=1
}
static func2()=>(t:=2)
}
t:="A: not changed"
class1.func1() ;global var: "not changed"
msgbox(t)
t:="B: not changed"
class1.func2()
;v2-a100: NOT EXPECTED: global var changed to: "2"
;v2-a108: OK, "not changed", fat-arrow func is assume-local!!
msgbox(t)
https://lexikos.github.io/v2/docs/Variables.htm#fat-arrow
The function is assume-local if it is nested inside another function, otherwise it is assume-global.
EDIT: oh nvm, methods r OK, but not-nested functions r assume-global still.
Code: Select all
t:="C: not changed"
func3()=>(t:=3)
func3()
msgbox(t) ; =3, changed :(
https://lexikos.github.io/v2/docs/commands/BufferAlloc.htm
FillByte: If omitted, the memory of the buffer is not initialized; the value of each byte is arbitrary.
but:
Remarks: All bytes within the buffer are zero-initialized.
3.
https://lexikos.github.io/v2/docs/Objects.htm#Usage_Arrays_of_Arrays
array should be 4 x 3 (__new method accepts (x, y))
grid := Array2D.new(3, 4) ;3 x 4, should be 4,3
4.
https://lexikos.github.io/v2/docs/commands/DllCall.htm#ExMouseSpeed
example 6 gives weird error "type mismatch at line 12"
also line 12: 0x71 should be replaced with SPI_SETMOUSESPEED for consistency
5.
https://lexikos.github.io/v2/docs/objects/Buffer.htm
ClipboardAll returns a sub-type of Buffer, also named ClipboardAll.