Posts: 102
	Threads: 16
	Joined: Aug 2019
	
Reputation: 
0
	 
 
	
		
		
		04.05.2023, 11:19 
(This post was last modified: 04.05.2023, 11:20 by a455115.)
		
	 
	
		Hello,
Is it possible for a resident script to be executed from a file that is uploaded to a device and not be visible in the window of the LM?
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 8422
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
 
	
	
		You can use a user library with "Keep source" disabled.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 102
	Threads: 16
	Joined: Aug 2019
	
Reputation: 
0
	 
 
	
	
		Can you give me some details?
How do I activate it? Can I change it if I need to?
Sorry for the stupid questions!
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 102
	Threads: 16
	Joined: Aug 2019
	
Reputation: 
0
	 
 
	
	
		Thank you so much!
Am I to understand that if I have the library saved, make changes and set it to the same name, it will overwrite the original library? Is this code backed up with the project?
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 8422
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
 
	
	
		Without "Keep source" only the compiled bytecode library is saved. The editor will be empty in this case because the source is not kept. You can put new code there and it will overwrite the current library. The backup will include such library but without the source code of course.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 102
	Threads: 16
	Joined: Aug 2019
	
Reputation: 
0
	 
 
	
	
		This is exactly what I needed.
Do I have to write this code (fn = require('user.my_user_library')fn()) in a resident script to call the library?
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 5287
	Threads: 29
	Joined: Aug 2017
	
Reputation: 
237
	 
 
	
	
		An example. I created user library with name 'test'
This is the library:
Code:
return function()
log('test')
end
 
Each time it is called it will create log 'test'
To cal it create a resident or any other script and use this code. 
Code:
fn = require('user.test')
fn()
 
	 
	
	
------------------------------
Ctrl+F5
	
		
	
 
 
	
	
	
		
	Posts: 102
	Threads: 16
	Joined: Aug 2019
	
Reputation: 
0
	 
 
	
	
		Thanks a lot, now I understand how it works.