The Script Files Dialog

 

Top  Previous  Next

This dialog is used for controlling the Script Files, it allows to start, stop and debug scripts.

Scripts_files_dialog

In the upper window of this dialog you see the list of loaded script files with the current state of each file. Any script can be in one of the following states:

 

State of File

Description

Stopped

Execution of the script file is temporarily stopped.

Running

The script file is being executed.

Waiting

The script is waiting for an event. This state is initiated by calling certain wait functions in the script file text (for example, Wait).

Cancelled

The script execution is terminated, but the script file is not yet unloaded from the memory.

 

To select a script file, highlight its name in the window. The four buttons on the right of the list control the highlighted script:

 

Button

Description

Terminate

Unloads the selected script file if it can be unloaded. Otherwise, it sets up the Unload Request flag for the selected script  that then goes to the Canceled state.

Terminate All

Unloads all script files visible in the window.

Restart

Restarts a highlighted script file.

Debug

Switches to the Debugger mode for the highlighted script file. This command stops execution of the script and opens it  in the source window of the script for debugging. If the script is in the wait state, then execution will immediately stop after the script returns from the Waiting status.

 

When you use several script files simultaneously and unload or restart some of them, remember that script files can share global data and functions. If one script accesses data or the functions belonging to another one that is already unloaded, then the script interpreter will issue error messages and the active script file will be also be unloaded (terminated).

The buttons and fields in the lower part of the dialog box control the script files starting:

Element of dialog

Description

Script File Name

Specifies a name of the script file to be loaded. You can either typed in the file name with a full path to the box or to take it from the drop-down history list or browse it from a computer disc.

Browse

Opens the Load/Execute Script File dialog for locating and loading script files into the Script File Name box.

Defines

Defines the processor text variables for compilation. For more information, see below the Processor text variables.

#include-file Directories

Specifies the directories in which the script file will search for the files specified in the #include <file_name> directive(s). To specify more than one directory, separate them by semicolons. The current directory is scanned as well.

Debug (open Script Source window)

If this box is unchecked, a script file automatically starts execution upon the  file loading. If the box is checked, then upon loading a script file, the program immediately opens the window for debugging the script. See also How to Debug a Script File.

Auto-save Script File Sources

If this box is checked when you click the Start button ChipProgUSB automatically saves the source texts of all script files visible in the Script Source windows.

Start

Starts the script file specified in the Script File Name box.

Processor text variables

The content of the Defines text box is equivalent to the #define directive in the C language. For example, if you type DEBUG in this text box, the result will be as if the #define DEBUG directive is placed in the first line of the script source text.

You can specify values for variables. For example, DEBUG=3 is equivalent to #define DEBUG 3.

You can list several variables in a line and separate them with semicolons. For example:

DEBUG;Passes=3;Abort=No

Also, see Predefined Symbols at the Script File Compilation.