ahkgetvar trouble

Ask for help, how to use AHK_H, etc.
think
Posts: 136
Joined: 09 Feb 2014, 05:20

ahkgetvar trouble

18 May 2020, 08:21

Trying to use ahk_h to evaluate the expression in a string. Any idea why this is not working with the decimals?

Code: Select all

dll:=ahkthread("#NoTrayIcon`n#Persistent")

;~ dll.ahkExec["result:=2+1"] ;works
;~ dll.ahkExec["result:=2.2+1`nmsgbox % result"] ;works
dll.ahkExec["result:=2.2+1"] ;not working

msgbox % dll.ahkgetvar("result")
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: ahkgetvar trouble

18 May 2020, 09:04

You need to make sure that result is a string:

Code: Select all

dll:=ahkthread("#NoTrayIcon`n#Persistent")

dll.ahkExec["result:=(2.2+1) """""]

msgbox % dll.ahkgetvar("result")
think
Posts: 136
Joined: 09 Feb 2014, 05:20

Re: ahkgetvar trouble

18 May 2020, 09:59

That was fast, thank you!

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 34 guests