[AHK_H v2] Macro Functions
Posted: 09 Oct 2017, 16:02
I have implemented experimental macro functions.
Let me know what you think about it
Now a function definition can be prefixed with 'macro ' (followed by space, not tab!) to create a macro instead of function.
Macro will use caller's scope for all variables except for parameters, function parameters will be resolved to local variables.
Dynamic variable references will also use caller's scope.
Global and static variables are not supported in macros.
Code: Select all
myfun("MyValue")
fun("AnotherValue")
MsgBox var
myfun(value:=""){
fun(value)
MsgBox var
}
macro fun(value){
var:=value
}
Deref function example
Alternative deref function example