MLPutArgCount()

int MLPutArgCount(MLINK link, int n)
specifies the number of arguments of a composite function to be put on link.

DetailsDetails

  • MLPutArgCount() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLPutArgCount() fails.
  • MLPutArgCount() is declared in the MathLink header file mathlink.h.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

#include "mathlink.h"

/* send Plus[2,3] over a link */

void f(MLINK lp)
{
    if(! MLPutType(lp, MLTKFUNC))
        { /* unable to send the function type to lp */ }

    if(! MLPutArgCount(lp, 2))
        { /* unable to put the number of arguments to lp */ }

    if(! MLPutSymbol(lp, "Plus"))
        { /* unable to put the symbol to lp */ }

    if(! MLPutInteger(lp, 2))
        { /* unable to put the integer to lp */ }

    if(! MLPutInteger(lp, 3))
        { /* unable to put the integer to lp */ }

    if(! MLEndPacket(lp))
        { /* unable to send the end-of-packet indicator */ }

    if(! MLFlush(lp))
        { /* unable to flush the link-output buffer */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »