Logic Machine Forum
How to edit common function using a script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: How to edit common function using a script (/showthread.php?tid=4079)



How to edit common function using a script - pouralise - 05.06.2022

Hi I want to know how to edit common function using a script. Anybody knows? Thank you.


RE: How to edit common function using a script - admin - 06.06.2022

There's an internal function script.checkuserlib(common_function_code) that does what you need.


RE: How to edit common function using a script - pouralise - 06.06.2022

(06.06.2022, 07:10)admin Wrote: There's an internal function script.checkuserlib(common_function_code) that does what you need.

Well, this code only write the whole common function to 'common_function_code'. But I also want to read the current common funtion code. Is there any other function to read it?


RE: How to edit common function using a script - admin - 06.06.2022

Can you explain why do you need this?


RE: How to edit common function using a script - pouralise - 06.06.2022

(06.06.2022, 15:20)admin Wrote: Can you explain why do you need this?

I have some Logic Machines (LMs) in several projects. And I have write some new functions in the newest project and want to have this function in every LMs. I will check the other LMs to see if they have the function or not, if they doesnt have the function then I will add that function to the common funtion. Of course all the work will be done by a script. I can't just copy all common function because each of LMs has some different fix variable (like, email, password, position...) so it's best if I only add the new function to all of the LMs that I've done.
While waiting your answer, I've already thought about add the new function to user libraries but I am still prefer to add it to common function.


RE: How to edit common function using a script - pouralise - 06.06.2022

Well. I dig a bit into the file and found what I want. Thank you