Version 6 of argc

Updated 2010-02-17 13:30:14 by LVwikignome

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 (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