Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: django013 on April 30, 2017, 11:41:28 AM
-
Hello,
I added a script to a tab-page onEnter, which contains a function and works so far.
Now I want to reuse that function from a buttons leftup script - and that fails. Where do I have to put functions right, so that both scripts can use it?
-
You will need to declare your functions in the Screen_Load_Script this will make it available at all objects within the Gui except the Lua Panels
DazTheGas
-
Thanks! That was the key.
As the manual didn't mention function declarations at all, I asked Mr.Google and he gave me a helping hand :D
Function declaration is just asigning a value to a variable =:O
Works pretty well and it is completely awfull, how fast lua is :)
-
Hello,
build 3384 broke this rule. Now no declarations from screenload script are recognized and I can not access functions. I added there.
What's the new way of doing it right?