unlike any other interpreted language, the nedit macro language suffer from the eval() function. so here is a rough copy'n'paste patch
syntax: eval(string)
Logged In: YES user_id=119143 Originator: NO
Good thing!
Logged In: YES user_id=122956 Originator: YES
the most natural macro menu entry:
eval:Alt+E:e:: {\n\ macro = string_dialog("Enter Macro to execute:", "Execute", "Cancel")\n\ if ($string_dialog_button == 1 && macro != "") {\n\ eval(macro)\n\ }\n\ }\n
Note: this isn't the way an eval() should work, its a function not a language construct, so its not possible to write something like this:
define test { eval("t_print(\"test called with \" $n_args \" arguments\")") }
eval() should execute the argument in the current frame and not start a new one. so this should pushed down to the parser/interpreter level.
Log in to post a comment.
Logged In: YES
user_id=119143
Originator: NO
Good thing!
Logged In: YES
user_id=122956
Originator: YES
the most natural macro menu entry:
eval:Alt+E:e:: {\n\
macro = string_dialog("Enter Macro to execute:", "Execute", "Cancel")\n\
if ($string_dialog_button == 1 && macro != "") {\n\
eval(macro)\n\
}\n\
}\n
Logged In: YES
user_id=122956
Originator: YES
Note: this isn't the way an eval() should work, its a function not a language construct, so its not possible to write something like this:
define test {
eval("t_print(\"test called with \" $n_args \" arguments\")")
}
eval() should execute the argument in the current frame and not start a new one. so this should pushed down to the parser/interpreter level.