Dynamic load script file

Scripter Studio version 4.7.1 (Std), 1.7.1 (Pro)
I am looking for a possibility to load and execute a sub script file from a main script.
The variable set in the sub script should be available in the main script.

I'm not sure if I understood what you mean? You can just call a procedure from a subscript from the main script (see script-based libraries demo). Is that what you are looking for?

Thank you for your response. That seems to work only before the execute/compile command.

I define a method : LoadAndRunScript(SubScriptFile: string)
I like to use this method in the main script. The SubScriptFile is only known during the execution of the main script.

You can just deifne that method and then implement it in delphi the way you want. This is specific and you will need to build it yourself, but I don't think it's complicated, all you would need to do is to load the script file in a scripter component and execute it. I would just suggest that you use a separated Scripter component to load the script file.

Thank you for your answer, that worked, but I want to set variables in main script by assigning values in the sub script. That seems not possible, but I think I can make a different kind of mechanism.