How does V2 implement this V1 code?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
TheArkive
Posts: 1030
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: How does V2 implement this V1 code?

07 Feb 2020, 09:52

@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
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

Re: How does V2 implement this V1 code?

28 Feb 2020, 06:36

Include [AHKv2.0-a108] Object_Array_Map to your code and code will work like in v1.
AHKv2.0 alpha forever.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: How does V2 implement this V1 code?

29 Feb 2020, 18:48

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

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: TAC109 and 58 guests