Passing object to command in AHK v2

Report problems with documented functionality
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Passing object to command in AHK v2

02 Nov 2013, 08:51

Following does not work because object is released before it is passed to command/function.

Code: Select all

Command,% [1,2,3]
command(p){
	MsgBox % IsObject(p)
}
lexikos
Posts: 9688
Joined: 30 Sep 2013, 04:07
Contact:

Re: Passing object to command in AHK v2

02 Nov 2013, 21:04

You're right that it doesn't work, but wrong about the reason. With a few specific exceptions, commands are not capable of accepting objects and never have been. ExpandExpression converts the object to a string before returning it, and ExpandArgs puts the string into the deref array which is used by most commands. This is one of a few limitations which are likely to remain until the underlying design is changed.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Passing object to command in AHK v2

03 Nov 2013, 04:02

I see, many thanks for explanation, I tried to debug but that was a bit over my head.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests