开发者

Execute TCL on windows XP

I installed tcl803.exe on my windows XP Operating System and my TCL path is C:\Tcl. Now I am unable to execute the TCL script on windows XP operating system. Please help me. Here I am very new. Please tell me each and every steps. Here is my TCL script. I writ开发者_如何学Pythone in a notepad and save it as a.tcl extension.

set x 50
set y 400
puts stdout "$x+$y=[expr {$x+$y}]"
puts stdout "-The addition of two variables $x and $y is [expr $x+$y]"


Do this at a DOS prompt:

assoc .tcl=TclScript
ftype TclScript=c:\Tcl\tclsh.exe %1 %*

However, it would be much easier for you to install ActiveTcl -- that install process will manage the file associations for you.


Tcl files aren't compiled, they're scripts that require they be handed to a Tcl interpreter to run. You have two primary options on Windows:

  1. Run the tcl interpreter with the script as an argument:

    tclsh.exe ddd.tcl

  2. Associate .tcl files with the tclsh (or wish) interpreters. I don't recall how to do this offhand, but it's similar to associate .doc items with Word... When you double click on the .tcl file it calls the executable (Tcl) and gives it the name of the .tcl file you clicked on.

Note: You can "compile" tcl code into an executable (tclkit, starkit), but you probably aren't at a point where you'd be comfortable doing so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜