9.15.7 Running Tcl Scripts from the Command Line
You can run Tcl scripts from your Windows® command line.
To execute a Tcl script file in the FlashPro® software from a shell command line:
- At the prompt, type the path to the software
followed by the word "SCRIPT" and a colon, and then the name of the script file as
follows:
<location of Actel software>/bin/flashpro.exe SCRIPT:<filename>- Executes in batch mode the script
foo.tcl:<location of Actel software>/bin/flashpro.exe script:foo.tcl - Executes in batch mode the script foo.tcl and exports the
log in the file
foo.txt:<location of Actel software>/bin/flashpro.exe script:foo.tcl logfile:foo.txt - Executes in batch mode the script foo.tcl, creates a console
where the log is displayed briefly, and exports the log in the file
foo.txt:<location of Actel software>/bin/flashpro.exe script:foo.tcl console_mode:brief logfile:foo.txt - If you leave console_mode unspecified or set it to 'hide', FlashPro executes without a console window.
- If you want to leave the console window open you can run the
script with the console_mode parameter set to 'show', as in the following example:
<location of Actel software>/bin/flashpro.exe script:foo.tcl console_mode:show logfile:foo.txt
If you leave console_mode unspecified or set it to 'hide' FlashPro executes without a console window. If you want to leave the console window open you can run the script with the console_mode parameter set to 'show', as in the following example:
<location of Actel software>/bin/flashpro.exe script:foo.tcl console_mode:show logfile:foo.txt - Executes in batch mode the script
- If you want to pass arguments to the Tcl
script from the command line, then use the "SCRIPT_ARGS" variable as
follows:
<location of Actel software>/bin/flashpro.exe SCRIPT:<filename> SCRIPT_ARGS:"param1 param2 param3"
Arguments passed to a Tcl script can be accessed through the Tcl variables argc and
argv. The example below demonstrates how a Tcl script accesses these arguments:
puts "Script name: $argv0"
puts "Number of arguments: $argc"
set i 0
foreach arg $argv {
puts "Arg $i : $arg"
incr i
}Note: Script names can contain spaces if the script name is protected with
double quotes:
flashpro.exe script:"flashpro tcl/foo 1.tcl"