OpenersNotesSection(Spacer1)Details

The following token values can be returned:

MLTKINT and MLTKREAL do not necessarily signify numbers that can be stored in C int and double variables.

MLGetNext() 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"

/* read the next type from the link */

void f(MLINK lp)
{
	int data;

	switch(MLGetNext(lp))
	{
		case MLTKINT:
			if(! MLGetInteger32(lp, &data))
				{ /* unable to read the integer from lp */ }
		/* ... */
	}
}

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

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