bug? obj.GetCapacity() != result in ahk v1

Discuss the future of the AutoHotkey language
hyaray
Posts: 26
Joined: 20 Jun 2015, 01:37

bug? obj.GetCapacity() != result in ahk v1

25 May 2019, 02:01

Code: Select all

o := {"a":"aa","b":"bb",2:"c","c":"d","e":"f"}
MsgBox(o.GetCapacity() . " " . o.Length() . " " . o.Count()) ;5 2 5
in ahk v1, return 8 2 5 :headwall: :headwall:

by the way, is there a build-in method to know a var([1,2] or {"a":"aa",2:"bb"}) is object or a array??
thanks a lot!!! :xmas:
Helgef
Posts: 4031
Joined: 17 Jul 2016, 01:02
Contact:

Re: bug? obj.GetCapacity() != result in ahk v1

25 May 2019, 04:12

5 is sufficient for your example, if you relied on it being 8 in v1, that would be a bug in your code.

You may want to have a look at this topic :arrow: Objects - preview of upcoming changes.

Cheers.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 9 guests