2 * argv - print information about various args
4 * Copyright (C) 1999 Landon Curt Noll
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.1 $
21 * @(#) $Id: argv.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/argv.cal,v $
24 * Under source code control: 1997/03/10 00:27:17
25 * File existed as early as: 1997
27 * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
28 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
32 * This file is part of the custom sample calc files.
34 * NOTE: You must use a calc that was compiled with ALLOW_CUSTOM= -DCUSTOM
35 * and run with a -C arg.
37 if (config("compile_custom") == 0) {
38 quit "calc compiled without -DCUSTOM";
39 } else if (config("allow_custom") == 0) {
40 quit "calc was run without the -D command line option";
46 local i; /* arg number */
47 local junk; /* throw away value */
50 * process each arg passed to us
52 for (i = 1; i <= param(0); ++i) {
54 * This won't really work because all the arg numbers
55 * will be reported as arg[0] ... but what the heck
56 * this is only a demo!
58 junk = custom("argv", param(i));