quote:
Originally posted by Eljay
Confirmed, sort of. It's quite hard to explain so I'll show examples that hopefully explain themselves.
Example 1:
code:
// main.js (this is in the script's root so it is loaded automatically)
Debug.Trace('1. Before LoadScriptFile');
MsgPlus.LoadScriptFile('\\C:\\test.js');
Debug.Trace('3. After LoadScriptFile');
code:
// C:\test.js
Debug.Trace('2. During LoadScriptFile');
quote:
Originally posted by Debug output
Script is starting
1. Before LoadScriptFile
3. After LoadScriptFile
2. During LoadScriptFile
Script is now loaded and ready
As you can see, test.js isn't executed immediately, but after main.js has finished being executed.
Example 2:
code:
// main.js (test.js remains the same as above)
function OnEvent_Initialize(){
Debug.Trace('1. Before LoadScriptFile');
MsgPlus.LoadScriptFile('\\C:\\test.js');
Debug.Trace('3. After LoadScriptFile');
}
quote:
Originally posted by Debug output
Script is starting
Script is now loaded and ready
1. Before LoadScriptFile
2. During LoadScriptFile
3. After LoadScriptFile
For some reason, when called after the initial script load by Plus!, the order is correct meaning that test.js was executed immediately.
Thank you! This was the problem, it's solved now. (But I found out it by myself already.
)