Controlling the Script Execution

Include Files

Your script documents can include other scripts. This can be useful to reduce the size of script documents and improve readability. Using Script DocumentPossible Includes you get a list of script files already shipped with Rocs that could be included. You can include a script file with the following command:

    include_script(string path);            // relative or absolute path to script file

Script Output

During the execution of an algorithm, debug and program output is displayed in the Debug & Script Output. If the scripting engine detects a syntax error in your script, the error is also displayed as debug message. Note that all program messages are also displayed at the debug output (displayed as bold text).

You can control the text that is displayed at the script output by the following functions:

    output(string message);            // displays the message as script output
    debug(string message);             // displays the message as debug output

Control Script Execution

There are different execution modes for your scripts.

You can control the text that is displayed at the script output by the following functions:

  • Start: Execute the script until it finishes.

  • Stop: Stop script execution (only available if a script is executing).

  • One Step: Execute script until one step ends. A step ends when the script calls the function interrupt():

            interrupt();    // ends a step
        
  • Debug: Execute script in debug mode. This opens the QtScript debug dialog.