@Helgef
thanks! Sorry, I've been digging as deep as I could, and somehow missed that page.
EDIT: can't believe I missed that ... oy
How does V2 implement this V1 code?
Re: How does V2 implement this V1 code?
Include [AHKv2.0-a108] Object_Array_Map to your code and code will work like in v1.
AHKv2.0 alpha forever.
Re: How does V2 implement this V1 code?
I have implemented DefineDefault for objects / map / arrays in AHK_H:
Code: Select all
m:=Map().DefineDefault('')
MsgBox m[''] ; empty
m.DefineDefault('non existent key/property!')
MSgBox m[''] ; non existent key/property!
m.DefineDefault(() => MsgBox('Function was called for non existent key/property.'))
MsgBox m[''] ; empty
m[''].Call() ; calls the function
m.DefineDefault()
MsgBox m[''] ; error key not found
Who is online
Users browsing this forum: TAC109 and 58 guests