MLEvaluate (C Function)

MLEvaluate has been replaced by WSEvaluate.

int MLEvaluate(MLINK link,char*string)

sends a string of input suitable for use with ToExpression[] to the Wolfram Language for evaluation.

Details

  • Unlike MLEvaluateString(), MLEvaluate() does not discard packets sent in response.
  • 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.

Examples

Basic Examples  (1)

:Begin:
:Function: f
:Pattern: KernelTime[]
:Arguments: {}
:ArgumentTypes: Manual
:ReturnType: Manual
:End:

#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 */
    switch(MLGetType(stdlink))
    {
        /* ... */
    }

    /* ... */    
}