DADiSP Worksheet Functions > Function Categories > Series Processing Language (SPL) > ARGCOUNT

 

ARGCOUNT

Purpose:

Returns the number of arguments specified in an SPL function.

Syntax:

ARGCOUNT

Returns:

A real.

Example:

myfun(a, b, c, d)
{
    return(argcount);
}

 

myfun(1) returns: 1

 

myfun(1, 1, 10) returns: 3

Example:

myfun2(a, b)
{
    if (argc < 2)
    {
        if (argc < 1) a = 10;
 
        b = 100;
    }
 
    return(a * b);
}

 

myfun2() returns: 1000

 

myfun2(1) returns: 100

Remarks:

Arguments to SPL functions are optional. ARGCOUNT is a simple method for checking if an argument was specified.

 

ARGCOUNT can be abbreviated ARGC.

 

ARGC returns the total number of input arguments. See ARGV to specify variables arguments in an SPL routine.

 

See OUTARGC for a count of output arguments.

 

See Optional Function Arguments for more information on optional SPL arguments.

See Also:

ARGV

GETARGV

ISVARIABLE

OUTARGC

RETURN

VALUETYPE