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


int MLEvaluate(MLINK link, char*string)
sends a string of input suitable for use with ToExpression[] to Mathematica for evaluation.
  • MLEvaluate() is only available for use in mprep MathLink template programs.
  • MLEvaluate() returns 0 on failure and a nonzero value on success.
  • MLEvaluate() is declared in the MathLink header file mathlink.h.
:Function: f
:Pattern: KernelTime[]
:Arguments: {}
:ArgumentTypes: Manual
:ReturnType: Manual

#include "mathlink.h"

/* read the Kernel's response to its evaluation of
{Date[], $TimeZone} */

void f(void)
    if(! MLEvaluate(stdlink, "{Date[],$TimeZone}"))
        { /* unable to send the expression to stdlink */ }

    /* now read the Kernel's response */
        /* ... */

    /* ... */