This global variable is provided by tclsh and wish. It gives you the arguments the app was called with as a list, similar to C's argv, but without the app name itself (you get that in ''::[argv0]''). We don't need ''[argc]'' as we can always determine [[llength $argv]]. zxvczxv hjklh '''DGP''' -- It is true that we do not need ''::argc'', but '''tclsh''' and '''wish''' and any application embedding Tcl that calls ''Tcl_Main()'' provide it anyway. argv0 describes the name of the top-level script that was invoked via tclsh or wish. http://purl.org/tcl/home/man/tcl8.3.2/UserCmd/tclsh.htm http://purl.org/tcl/home/man/tcl8.3.2/UserCmd/wish.htm See [command options] for a discussion of various options one has in parsing the argv (and argv-like) information. Also, note that [[[info] script]] describes the name of the currently executing script and this name even gets set by [source]. ''Technically, it is set by Tcl_FSEvalFile(), for those using Tcl's C API.'' The command [[[info] nameofexecutable]] describes the name of the executing binary, and might be thought more like the C level argv[[0]]. Some code available that helps process the argv arguments include: What: clig (Kirsch) Where: http://wsd.iitb.fhg.de/%7Ekir/clighome/ Description: Command Line Interpreter Generator creates an interpreter which can recognize flag, float, int or string type options, multi-parameters, rangers, defaults, mandatory arguments, readable usage msgs. Reads a simple description file. Code generates standard C. Currently at v1.9.10 . Contact: mailto:kir@iitb.fhg.de (Harald Kirsch) What: CmdLine Where: http://www.enteract.com/%7Ebradapp/ftp/ Description: OODC++ library and driver to parse command line arguments. Written by the author of ParseArgs, but completely redesigned and rewritten - has no dependency on ParseArgs. Updated: 09/1996 Contact: mailto:Brad_Appleton-GBDA001@email.mot.com (Brad Appleton) What: evaluate_parameters Where: ftp://ftp.Lehigh.EDU/pub/evap/evap-2.x/evap-2.2.tar.Z http://www.neosoft.com/tcl/ftparchive/sorted/packages-7.6/devel/evap-2.1.tar.gz Description: evaluate_parameters is a Perl program that processes command line arguments in a simple consistent manner performing type-checking, multi-levels of help, etc. generate_tk_program is an auxiliary program which generates a Tcl/Tk GUI wrapper around one's Perl or C program to gather the command line arguments interactively. Updated: 10/1999 Contact: mailto:lusol@lehigh.edu (Stephen O. Lidie) What: ParseArgs Where: From comp.sources.misc archives, volume 29 ftp://wuarchive.wustl.edu/usenet/comp.sources.misc/volume29/parseargs Description: Utility library for parsing command line arguments in various languages (including Tcl) and on various hardware platforms Updated: 09/1996 Contact: mailto:Brad_Appleton-GBDA001@email.mot.com (Brad Appleton) What: argp Where: http://www.chevreux.org/projects_tcl.html Description: Simple and flexible argument parsing for Tcl - particularly good for parsing command line arguments or the args proc argument. Supports implicit type and value checking. Currently version 0.2 . Updated: 10/2001 Contact: mailto:bach@mwgdna.com (Bastien Chevreux) What: argument parsing with defaults (Wagner) Where: From the contact Description: Tcl code to parse arguments and provide default values. See theObjects-2.x for a C version. Updated: Contact: mailto:gandalf@Csli.Stanford.EDU (Juergen Wagner) mailto:Juergen.Wagner@iao.fhg.de (Juergen Wagner) What: argument processing for Tcl (Lehenbauer) Where: From the contact Description: Provides Tk-like argument processing to Tcl proc writers. Updated: Contact: mailto:karl@NeoSoft.com (Karl Lehenbauer) What: argument processing (Zimmer) Where: http://www.MapFree.com/sbf/tcl/scripts1.html Description: Tcl based argument processing. Updated: 04/1999 Contact: mailto:jazimmer@acm.org What: SimpleOpt Where: From the contact Description: Tcl only argument parsing code Updated: 06/1999 Contact: mailto:jcgil@gmv.es (Juan Carlos Gil Montoro) What: sneaky_eval Where: From the contact Description: Preprocess arguments before calling RecordAndEval or Eval, surrounding the arguments with braces so they won't be sub-evaluated. Updated: Contact: mailto:mdimeo@brooktree.com (Matt DiMeo) What: SNTL Where: http://www.csua.berkeley.edu/%7Esls/woa/distrib/ http://www.neosoft.com/tcl/ftparchive/sorted/packages-7.6/devel/sntl-0.4.2.tar.gz http://www.neosoft.com/tcl/ftparchive/sorted/packages-7.6/devel/sntl-0.4.2p1.patch.tar.gz Description: A general Tcl library of procedures. Contains code to produce man pages from Tcl source, conversions from Tcl to C, HTML rendering, generating HTML, handling CGI forms, command line argument processing, a debugging message system, an object system, and various Tk widgets built with the object system. Updated: 10/1998 Contact: mailto:slshen@lbl.gov (Sam Shen) mailto:sls@aero.org (Sam Shen) What: variable argument process Where: From the contact Description: Tcl procedure (args) to make handling variable number of procedure arguments and keywords easier to process. Updated: Contact: mailto:gandalf@Csli.Stanford.EDU (Juergen Wagner) What: yaap - Yet Another Argument Parsing utility Where: http://www.neosoft.com/tcl/ftparchive/sorted/packages-7.6/devel/yaap-0.9.shar.gz Description: Template based argument parsing utility, inspired by XtGetApplicationResources() function. Updated: 10/1998 Contact: mailto:pzi@interlog.com (Peter Ziobrzynski) ---- [Tcl syntax help] - [Arts and crafts of Tcl-Tk programming]