AHK V2, Object(obj): is doc correct?

Discuss the future of the AutoHotkey language
SAbboushi
Posts: 142
Joined: 08 Dec 2014, 22:13

AHK V2, Object(obj): is doc correct?

14 Jul 2018, 16:21

In v2 changes doc:
Object(obj) no longer calls AddRef and returns the object's address.
I'm getting error:
Error: Parameter #1 invalid.

Line#
001: obj := {}
---> 002: Address := Object(obj)
003: Exit
004: Exit
004: Exit

The current thread will exit.

Code: Select all

obj:={}
Address := Object(obj)
lexikos
Posts: 6207
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: AHK V2, Object(obj): is doc correct?

14 Jul 2018, 19:11

Is what doc correct?

You seem to expect Object(obj) to return an address, but the document you quoted is telling you it does not do that anymore.

If there is any reference to Object(obj) in the actual v2 documentation, it is an error left over from v1.
User avatar
nnnik
Posts: 3539
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: AHK V2, Object(obj): is doc correct?

15 Jul 2018, 04:00

As a non english native I did not understand that correctly - it was not apperent that the second sentence is also negated.
Recommends AHK Studio
guest3456
Posts: 2469
Joined: 09 Oct 2013, 10:31

Re: AHK V2, Object(obj): is doc correct?

15 Jul 2018, 06:52

nnnik wrote:As a non english native I did not understand that correctly - it was not apperent that the second sentence is also negated.
for english natives too

SAbboushi
Posts: 142
Joined: 08 Dec 2014, 22:13

Re: AHK V2, Object(obj): is doc correct?

15 Jul 2018, 08:27

He He! Yes - that's why I posted. I misunderstood too (English is my native language too)
lexikos
Posts: 6207
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: AHK V2, Object(obj): is doc correct?

17 Jul 2018, 02:01

I assumed so when I replied, but didn't care to mention it.

v1: Object(obj) [calls AddRef and returns the object's address].
v2: Object(obj) no longer [calls AddRef and returns the object's address].

I'm sure someone can fix it.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 3 guests