This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function


MLMARK MLCreateMark(MLINK link)
creates a mark at the current position in a sequence of expressions on a link.
  • Calling MLCreateMark()creates a bookmark in the expression stream on the link. This mark allows you to return to the marked point in the expression stream at a later time. MLCreateMark() effectively starts recording the expressions on the link.
  • MLCreateMark() returns (MLMARK)0 in the event of an error.
  • MLCreateMark() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* check for a ReturnPacket and go back in the expression stream if necessary */

void f(MLINK lp)
    MLMARK mark;
    int args;

    mark = MLCreateMark(lp);
    if(mark (MLMARK)0)
        { /* mark creation failed */ }

    if(! MLTestHead(lp, "ReturnPacket", args))
            MLSeekToMark(lp, mark, 0);
            MLDestroyMark(lp, mark);
        { /* read the ReturnPacket[] */ }