Version 11 of tclvars

Updated 2008-05-10 11:01:42 by lars_h collects the formal reference info for tclvars...

The variables tcl_wordchars and tcl_nonwordchars define what letters are treated as valid for words. The variables are auto-loaded along with the commands they control, such as tcl_endOfWord.

This means that to change the characters that are valid, you must first do something like:

        catch {tcl_endOfWord}

After this, you can then do something like:

    # We want the same behaviour on Windows as on Unix for double-clicking
    set tcl_wordchars {[a-zA-Z0-9_]}
    set tcl_nonwordchars {[^a-zA-Z0-9_]}

MG The defaults for Unix (or rather, non-Windows), according to the docs for Tcl 8.4.9, are actually \w and \W (with \s and \S on Windows), which might differ from the above due to locale. Personally, I tend to use

  set tcl_wordchars {[a-zA-Z0-9' ]}
  set tcl_nonwordchars {[^a-zA-Z0-9']}

for my apps on Windows - I tend to find that gives much more natural behaviour, particularly compared to other apps when you move the cursor a word at a time with Control-Left / Control-Right.

LV [add info on what routines actually use these variables]

  • argc - number of arguments the script was called with
  • argv - list arguments the script was called with

Unlike C, the argv does not include the name of the application itself among the argument list.

  • auto_execs
  • auto_index
  • auto_noexec
  • auto_noload
  • auto_path
  • dir
  • env(TCL_LIBRARY)
  • unknown_pending

See also "Tcl syntax help" and "magic names".

Category Internals