[question] Deref / Expression in String Topic is solved

Discuss the future of the AutoHotkey language
_3D_
Posts: 134
Joined: 29 Jan 2014, 14:40

[question] Deref / Expression in String

29 Aug 2017, 03:58

a079 Deref() omited.
Will be there in the future some method to resolve only variable value in expression (not variable alone) stored in string without evaluation?

Code: [Select all] [Download] GeSHi © Codebox Plus

a:= "A_Index+13"
deref(a) => "<value>+13" for example "4+13"
AHKv2.0 use the future now.
_3D_
Posts: 134
Joined: 29 Jan 2014, 14:40

[Solution] [question] Deref / Expression in String  Topic is solved

29 Aug 2017, 06:01

Crazy people self asked self answered - partial solution - edited "while" prevent using A_Index and all loop variables

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Code replace variables with there values.
Due to no inline function or macros and variable scope this code must be stored at the place where variables must be deref.
Evaluation from tidbit

Code: [Select all] [Download] GeSHi © Codebox Plus

dd_tidbitEval(expression) { ; 
obj:=ComObjCreate("HTMLfile") ;tidbit code ------------------------------------
obj.write("<body><script>document.body.innerText=eval('" expression "');</script>") ;--
return obj.body.innerText
}
Functions not allowed.

Enjoy!
AHKv2.0 use the future now.
Helgef
Posts: 2228
Joined: 17 Jul 2016, 01:02
Contact:

Re: [question] Deref / Expression in String

01 Sep 2017, 00:09

Hello. Interesting code. Maybe this will interest you, function macro, see the example.
_3D_
Posts: 134
Joined: 29 Jan 2014, 14:40

Re: [question] Deref / Expression in String

01 Sep 2017, 02:50

Helgef wrote:Hello. Interesting code. Maybe this will interest you, function macro, see the example.
AutoHotkey_2.0-a081-cad307c

Code: [Select all] [Download] GeSHi © Codebox Plus

; Call to nonexistent function.
; Specifically: macro
macro mFunc(arg) {
arg:= 1
}
AHKv2.0 use the future now.
Helgef
Posts: 2228
Joined: 17 Jul 2016, 01:02
Contact:

Re: [question] Deref / Expression in String

01 Sep 2017, 03:04

Sorry I didn't specify, it is for ahk_h.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 1 guest