MLCreateMark (C Function)

MLCreateMark has been replaced by WSCreateMark.

MLMARK MLCreateMark(MLINK link)

creates a mark at the current position in a sequence of expressions on a link.

Details

  • 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.

Examples

Basic Examples  (1)

#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);
        }
    else
        { /* read the ReturnPacket[] */ }
}