OpenersNotesSection(Spacer1)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 ((NonWLLink[MLMARK, paclet:ref/c/MLMARK]))0 in the event of an error.

MLCreateMark() is declared in the MathLink header file (RefLink[mathlink.h, paclet:ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)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[] */ }
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLSeekToMark(), paclet:ref/c/MLSeekToMark])  ▪  (NonWLLink[MLDestroyMark(), paclet:ref/c/MLDestroyMark])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}})}})