Version 8 of argc

Updated 2012-11-30 19:33:08 by pooryorick

argc is a global namespace Tcl variable set by tclsh, wish and other code doing similar setup.

It contains a count of the number of arguments passed to the command upon invocation.

The count begins at 1, and the count does not include the name of the script itself (which in tclsh can be found in argv0) (both of which is different from C's argc).

# program usage requires at least one argument
if { $::argc eq 0 } {
   puts "USAGE: $::argv0 argument"
   exit 1
}

See also: argv