Version 4 of Tcl on Windows FAQ

Updated 2012-04-23 17:12:47 by dkf

APN I have made a *rough* draft of a new Tcl on Windows FAQ . Eventually I hope it will replace the Tcl Windows FAQ on [L1 ] and sourceforge. It is meant partly as a FAQ and partly to let prospective Tcl'ers that you can do a lot more with Tcl on Windows than indicated in the outdated FAQs.

Please comment below on any and all of the following:

  • questions that should not be in there
  • questions that should be in there but are not
  • editorial comments, better clarity etc.
  • errors of course
  • anything else

There are a few unanswered questions marked by 'TBW'. Answers to these are welcome.


pi31415: How can I launch a web page with TCL? APN Why the {} ? Seems to work with or without it ? Also, it is a LOT slower than executing the same from the DOS command line. Any idea why?

[catch {exec {*}[auto_execok start] {} [list $url]}]

dkf - 2012-04-23 17:12:47

Everywhere you have exec [auto_execok … it is wrong. :-) That's because auto_execok returns a list of words; the recommended way is exec {*}[auto_execok … The expansion operator is critical! If you're using 8.4 and before, you have to use eval exec and be much more careful because Windows command lines often (usually?) contain backslashes.

Wrong

exec [auto_exec start] "" [file nativename [file normalize foo.bar]]

Right

exec {*}[auto_exec start] "" [file nativename [file normalize foo.bar]]

Wrong (8.4 and before)

eval exec [auto_exec start] "" [file nativename [file normalize foo.bar]]

Right (8.4 and before)

eval exec [auto_exec start] [list "" [file nativename [file normalize foo.bar]]]

or

eval [linsert [linsert [auto_exec start] 0 exec] end "" [file nativename [file normalize foo.bar]]]

I do recommend using 8.5 or later. :-)