OpenersNotesSection(Spacer1)Details

MLMessageReady() returns a nonzero value if a message is available for reading and 0 otherwise.

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

/* calculate the sum of the integers in a list and check for a message on a link */

int f(MLINK lp, int *list, int len)
{
	int sum;
	while(len--)
	{
		sum += *list++;
		if(MLMessageReady(lp))
			{ /* read the message */ }
	}

	return sum;
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLPutMessage(), paclet:ref/c/MLPutMessage])  ▪  (NonWLLink[MLPutMessageWithArg(), paclet:ref/c/MLPutMessageWithArg])  ▪  (NonWLLink[MLGetMessage(), paclet:ref/c/MLGetMessage])  ▪  (NonWLLink[MLSetMessageHandler(), paclet:ref/c/MLSetMessageHandler])  ▪  (NonWLLink[MLGetMessageHandler(), paclet:ref/c/MLGetMessageHandler])}})}})