MLNewPacket has been replaced by WSNewPacket.

int MLNewPacket(MLINK link)

skips to the end of the current packet on link.


  • MLNewPacket() works even if the head of the current top-level expression is not a standard packet type.
  • MLNewPacket() does nothing if you are already at the end of a packet.
  • MLNewPacket() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLNewPacket() fails.
  • MLNewPacket() is declared in the MathLink header file mathlink.h.


Basic Examples  (1)

#include "mathlink.h"

/* read the next number from a link and ignore everything else */

void f(MLINK lp)
    /* determine the type of the data on the link */
        case MLTKINT:
            /* integer data */
        case MLTKREAL:
            /* floating point data */
            /* Skip to the next packet if not a number. */
            if(! MLNewPacket(lp))
                { /* unable to jump ahead to the next packet on lp */ }

See Also

MLGetNext()  MLEndPacket()