Next: , Up: Positional Arguments Access   [Index]


9.5.1 Positional Arguments Accessor Functions

count

integer count(void);

Is the number of (aime) function arguments.

integer
three(integer a, real b, text c)
{
    return count();
}

The function ‘three’ returns 3.

lead

object lead(integer p);

Is the argument in the p position.

integer
first(integer a, real b, text c)
{
    return lead(0);
}

The function ‘first’ returns the value of a.

set

void set(integer p, object o);

Sets the argument in the p position as o.

integer
six(integer a, real b, text c)
{
    set(0, 1);
    set(1, 2r);
    set(2, "3");

    return a + b + atoi(c);
}

The function ‘six’ returns 6.