Page 1 of 1

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

Posted: 14 Jul 2018, 16:21
by SAbboushi
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)

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

Posted: 14 Jul 2018, 19:11
by lexikos
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.

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

Posted: 15 Jul 2018, 00:02
by SAbboushi
k thanks

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

Posted: 15 Jul 2018, 04:00
by nnnik
As a non english native I did not understand that correctly - it was not apperent that the second sentence is also negated.

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

Posted: 15 Jul 2018, 06:52
by guest3456
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

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

Posted: 15 Jul 2018, 08:27
by SAbboushi
He He! Yes - that's why I posted. I misunderstood too (English is my native language too)

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

Posted: 17 Jul 2018, 02:01
by lexikos
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.