modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / etc / calc / help / argv
blobd42bdbc916f68f259722b913494ab55cc4d1204c
1 NAME
2     argv - count or value of a calc command line supplied argument
4 SYNOPSIS
5     argv([n])
7 TYPES
8     n           nonnegative integer
10     return      any
12 DESCRIPTION
13     Without args, this builtin returns the number of calc command line
14     strings available.
16     If the numeric arg is supplied, then the corresponding command line
17     string is return, if it exists.  Otherwise a nul() value is returned.
19     In keeping with the argc/argv convention of C, argv(0) will refer
20     to the 1st argv string, and argv(argv()-1) will refer to the last.
21     This differs from the way the param() builtin works.
23     By default, calc will evaluate all of its command line arguments.
24     However, if calc is invoked with -s, all non-dashed options will
25     be left as unevaluated strings.  Thus:
27         calc -i 2+2
29     will cause calc to print 4 and enter interactive mode.  In this case
30     argv() will return 0.
32     On the other hand:
34         calc -i -s 2+2
36     will cause calc to interactive mode.  The argv() builtin will return 1
37     and argv(0) will return the string "2+2".
39 EXAMPLE
40     $ calc -s a bb ccc
41     ; argc = argv();
42     ; for (i = 0; i < argc; i++) print "argv[": i : '] = "': argv(i) : '"';
43     argv[0] = "a"
44     argv[1] = "bb"
45     argv[2] = "ccc"
47 LIMITS
48     0 <= n < 2^31
50 LINK LIBRARY
51     none
53 SEE ALSO
54     param, system, usage
56 ## Copyright (C) 1999-2006  Landon Curt Noll
58 ## Calc is open software; you can redistribute it and/or modify it under
59 ## the terms of the version 2.1 of the GNU Lesser General Public License
60 ## as published by the Free Software Foundation.
62 ## Calc is distributed in the hope that it will be useful, but WITHOUT
63 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
64 ## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
65 ## Public License for more details.
67 ## A copy of version 2.1 of the GNU Lesser General Public License is
68 ## distributed with calc under the filename COPYING-LGPL.  You should have
69 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
70 ## 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
72 ## @(#) $Revision: 30.1 $
73 ## @(#) $Id: argv,v 30.1 2007/03/16 11:10:42 chongo Exp $
74 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/argv,v $
76 ## Under source code control:   1999/11/23 19:45:05
77 ## File existed as early as:    1999
79 ## chongo <was here> /\oo/\     http://www.isthe.com/chongo/
80 ## Share and enjoy!  :-)        http://www.isthe.com/chongo/tech/comp/calc/