MLGetArgCount()

int MLGetArgCount(MLINK link, int *n)
finds the number of arguments to a function on link and stores the result in n.

DetailsDetails

  • MLGetArgCount() is declared in the MathLink header file mathlink.h.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

#include "mathlink.h"

/* check a link for a function and return the number of arguments */

int f(MLINK lp)
{
    int a;

    switch(MLGetType(lp))
    {
        case MLTKFUNC:
            /* get the argument size */
            if(! MLGetArgCount(lp, &a))
                { /* unable to get the number of arguments from lp */ }
            return a;
        default:
            /* ... */
    }

    /* ... */
}
New to Mathematica? Find your learning path »
Have a question? Ask support »