failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / param
1 NAME
2     param - value of argument in a user-function call
3
4 SYNOPSIS
5     param([n])
6
7 TYPES
8     n           nonnegative integer
9
10     return      any
11
12 DESCRIPTION
13     The function param(n) can be used only within the body of the
14     definition of a function.
15
16     If that function is f()
17
18         [[ which may have been defined with named arguments as in f(x,y,z))
19
20     and either the number of arguments or the value of an argument
21     in an anticipated call to f() is to be used, the number of
22     arguments in that call will then be returned by:
23
24         param(0)
25
26     and the value of the n-th argument by:
27
28         param(n)
29
30     Note that unlike the argv() builtin, param(1) is the 1st parameter
31     and param(param(0) is the last.
32
33 EXAMPLE
34     > define f() {
35     >>  local n, v = 0;
36     >>  for (n = 1; n <= param(0); n++)
37     >>          v += param(n)^2;
38     >>  return v;
39     >> }
40
41     > print f(), f(1), f(1,2), f(1,2,3)
42     0 1 5 14
43
44 LIMITS
45     none
46
47 LINK LIBRARY
48     none
49
50 SEE ALSO
51     argv, command
52