I stopped relying on ActiveTcl when they dropped free support for Solaris, which I still work on. Since then my preferred Tcl distribution is https://sourceforge.net/projects/kbskit/ . I use the "batteries included" builds which include a good selection of add-on packages. Kbskit also has the advantages of needing no installation (just put one executable on your PATH), being freely redistributable and supporting making your own builds for less common architectures.
Tcl has excellent books, not so great web resources. Tcl and the Tk Toolkit by Tcl's original author is the classic, Tcl/TK: A Developer's Guide has lots of exercises if you prefer something more hands-on.
Also it has really good man pages. Not a huge help when you're first getting started, but keep them in mind once you have your feet under you and just need to look up how a particular command works.
My standard disclaimer: I'm not currently at a computer with tcl installed, so any example I type is done "blind".
Look at the manual page for format (http://www.tcl.tk/man/tcl8.6/TclCmd/format.htm) under "Optional Size Modifier".
Since you provided neither an l, nor an h, the integer value was truncated to the same range as int(), which could easily be 32 bits.
If you don't want any truncation, try %015lld
If you need it to behave specifically as wide(), do %015ld instead
>I first call a then c, I was assuming the upvar command would look up and get the b value but it doesn't. Why is this the case.
Because "upvar 1" does indeed only look up one level and if that level is the global namespace (and "set b" is defined only inside proc "a") then the upvar will not see "b".
>Another case when I call c from within a
Exact same answer, "upvar 1" only looks up 1 level, in this case that level is the body of proc "a" where "b" is indeed defined.
You should read the official documentation for upvar, it is very informative: http://www.tcl.tk/man/tcl8.6/TclCmd/upvar.htm
Also there is no reason to use "echo" in Tcl, you should use "puts" instead which is the native Tcl command.
Wow, nice offer. I was just working up to asking if you had plans to open source any of your components, or perhaps just blog about the dev experience. I'd be interested to hear about it, as I'm sure would many others.
Come to think of it, a quick session at Eindhoven or Texas would go over well, if either is convenient for you to travel.
TIP 352 [1] is the Tcl Style Guide. Refer to it.
As far as I know, Tcllib has a set of tools called doctools [2], though I have never tried it.
[1] http://www.tcl.tk/cgi-bin/tct/tip/352.html
[2] http://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/doctools/doctools.html
If you're not trying to make well-designed UIs that feel at home in GNOME Shell, OS X, Metro, etc, then Tcl/Tk is definitely the way to go.
Can do a script like
package require Tk # set up command procs set pd [list ...]; # make this your list of items tk_optionMenu .pulldown {*}$pd button .test1 -text "Run Test 1" -command test1 button .test2 -text "Run Test 2" -command test2 entry .dir -textvariable dir entry .fname -textvariable fame button .quit -text "Quit" -command exit
pack .pulldown pack .test1 pack .dir pack .fname pack .test2 pack .quit
pack
as well as grid
and place
are how you put widgets in the window. I recommend reading up on the docs and there are plenty of examples online. This example isn't meant to be instructive on Tcl/Tk, but to show you how little code is necessary to accomplish the UI you've described, and can be shorter still, as the pack
and widget creation lines need not be separate, e.g.
pack [button .quit -text "Quit" -command exit]
Might not be a popular choice here, but I really like Practical Programming in Tcl and Tk by Welch. That's how I learned Tcl/Tk, starting with the 2nd edition. The 4th edition goes up to only Tcl 8.4, but the manual can fill in the rest.