OpenersNotesSection(Spacer1)Details

Calling WSCreateMark()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. WSCreateMark() effectively starts recording the expressions on the link.

WSCreateMark() returns ((NonWLLink[WSMARK, paclet:ref/c/WSMARK]))0 in the event of an error.

WSCreateMark() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

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

void f(WSLINK lp)
{
	WSMARK mark;
	int args;

	mark = WSCreateMark(lp);
	if(mark == (WSMARK)0)
		{ /* mark creation failed */ }

	if(! WSTestHead(lp, "ReturnPacket", args))
		{
			WSSeekToMark(lp, mark, 0);
			WSDestroyMark(lp, mark);
		}
	else
		{ /* read the ReturnPacket[] */ }
}

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

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[Low-Level WSTP Operations, paclet:guide/LowLevelWSTPOperations])}})}})