This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function

MLClearError()

int MLClearError(MLINK link)
clears errors on link if possible.
  • MLClearError() will activate a previously unactivated link.
  • MLClearError() will return 0 for certain catastrophic errors such as MLEDEAD that indicates that the link has closed unexpectedly.
  • MLClearError() returns a nonzero value on successful completion.
  • MLClearError() is declared in the MathLink header file mathlink.h.
#include <stdio.h>
#include "mathlink.h"

/* send an integer to a link and check for an error */

void f(MLINK lp)
{
    if(! MLPutInteger(lp, 10))
    {
        printf("MathLink error: %s\n", MLErrorMessage(lp));
        MLClearError(lp);
    }
}