Howto:Load a Nasal file at runtime: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (Robot: Cosmetic changes)
No edit summary
Line 28: Line 28:
This piece of code defines a new function named "loader" that just invokes the io.load_nasal() function to load and execute a Nasal script, the filename being "loadme.nas.txt" (the .txt. extension is just to prevent the file from being loaded during startup).
This piece of code defines a new function named "loader" that just invokes the io.load_nasal() function to load and execute a Nasal script, the filename being "loadme.nas.txt" (the .txt. extension is just to prevent the file from being loaded during startup).


The _setlistener call at the end of the snippet waits for the Nasal system to be initialized before the "mycode" function gets called.
The _setlistener call at the end of the snippet waits for the Nasal system to be initialized before the "loader" function gets called.


Then create another file containing:
Then create another file containing:
1

edit

Navigation menu