|
Valkenar Beginner
Joined: 12 Aug 2009 Posts: 15
|
Posted: Wed Nov 04, 2009 5:38 pm
[3.12] Lua functions and execfunc |
When an alias or function written in lua attempts to call a function written in a lua using execfunc, the arguments are lost.
For example:
Function1:
zs.say("Function called")
zs.say(zs.params(1))
zs.say("Function end")
Function 2:
zs.execfunc("function1", "hello")
Then on the command prompt enter
#noop @function1(hello)
Outputs:
Function1 called
hello
Function1 End
Next on the command prompt enter
#noop @function2()
Outputs:
Function1 called
Function1 End
It seems only to keep arguments from the command line. For example
#noop @function2(hello)
Outputs:
Function1 called
hello
Function1 End
Even though the argument passed to function2 is never accessed. The lua functions seem to be sharing a common argument scope.
The help file says:
print( zs.execfunc("test",123))
calls the "test" function with the number 123 as the first argument (%1) and prints the value returned from the function
If the current behavior is considered correct, then the help file needs updating. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Nov 06, 2009 5:24 pm |
Confirmed and added to bug list.
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|