returning object values

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
keokio
Posts: 10
Joined: 28 Oct 2019, 23:03

returning object values

10 Nov 2019, 21:33

im new to objects, and i have this code at the bottom. Is there a way to just put the 'list_search.returnstring' into the third line instead of the %x%. This way I can omit the 2nd line with setting a value x:= list_search.returnstring. Thanks.

Code: Select all

list_search.string("ish", "combobox5", "Font")
x := list_search.returnstring
control, choosestring, %x%, combobox5, Font
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: returning object values

10 Nov 2019, 22:13

Try to force an expression:

Code: Select all

list_search.string("ish", "combobox5", "Font")
control, choosestring, % list_search.returnstring, combobox5, Font
https://www.autohotkey.com/docs/Variables.htm#Expressions wrote:Force an expression: An expression can be used in a parameter that does not directly support it (except OutputVar parameters) by preceding the expression with a percent sign and a space or tab. In [v1.1.21+], this prefix can be used in the InputVar parameters of all commands except the traditional IF commands (use If (expression) instead). This technique is often used to access arrays.
keokio
Posts: 10
Joined: 28 Oct 2019, 23:03

Re: returning object values

10 Nov 2019, 22:55

gregster wrote:
10 Nov 2019, 22:13
Try to force an expression:

Code: Select all

list_search.string("ish", "combobox5", "Font")
control, choosestring, % list_search.returnstring, combobox5, Font
https://www.autohotkey.com/docs/Variables.htm#Expressions wrote:Force an expression: An expression can be used in a parameter that does not directly support it (except OutputVar parameters) by preceding the expression with a percent sign and a space or tab. In [v1.1.21+], this prefix can be used in the InputVar parameters of all commands except the traditional IF commands (use If (expression) instead). This technique is often used to access arrays.
wow that worked perfectly, thank you!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 205 guests