WSEvaluate()
This feature is not supported on the Wolfram Cloud.

int WSEvaluate(WSLINK link,char*string)
sends a string of input suitable for use with ToExpression[] to the Wolfram Language for evaluation.

DetailsDetails

  • Unlike WSEvaluateString(), WSEvaluate() does not discard packets sent in response.
  • WSEvaluate() is only available for use in mprep WSTP template programs.
  • WSEvaluate() returns 0 on failure and a nonzero value on success.
  • WSEvaluate() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

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

#include "wstp.h"

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

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

    /* now read the Kernel's response */
    switch(WSGetType(stdlink))
    {
        /* ... */
    }

    /* ... */    
}