I have started using the include function when dynamically writing external script files. If you write a dynamic external script file then call it with the Macro> function the external script runs independently of your master script, the master script stops until the external script completes and there are extra steps needed to pass information from the external script back into your master script. All issues are resolved if you instead use the Include> function since the dynamic script is absorbed by the master script and is essentially a part of the original script.
The issue I want to mention occurs when a script containing a dynamically created included file is compiled. For some reason if it is compiled with the "Includes" variable set to 1 (the default), the included script will not function. If the script is compiled with the "Includes" variable set to 0, all works as planned.
I do not currently have an issue with this but I could see where this could be detrimental if a script were created with the intention of it being compiled and the script also contained conventional includes.
Here is a sample to demonstrate what I've so in eloquently been trying to explain. If you compile this with "Compile includes" checked, the script will fail. You will not see a message when the executable is run. If you compile this with "Compile includes" unchecked, you will see th message when the executable is run.
Code: Select all
C:\includetest.scp
WriteLn>C:\includetest.scp,wres,MDL>Included
Include>C:\includetest.scp
DeleteFile>C:\includetest.scp