WSEvaluateString (C 関数)
int WSEvaluateString(WSLINK link,char *string)
Wolfram言語に文字列を送信し評価させる.評価の結果として返されるパケットはすべて放棄される.
例題
例 (1)
:Begin:
:Function: f
:Pattern: KernelTime[]
:Arguments: {}
:ArgumentTypes: Manual
:ReturnType: Manual
:End:
#include "wstp.h"
/* read the Kernel's response from evaluating the expression
{Date[],$TimeZone} */
void f(void)
{
/* Pretend we are not in our local timezone. */
if(! WSEvaluateString(stdlink, "$TimeZone = 9;"))
{ /* unable to send $TimeZone = 9; to stdlink */ }
if(! WSEvaluate(stdlink, "{Date[],$TimeZone}"))
{ /* unable to send the expression to stdlink */ }
/* get the Kernel's response */
switch(WSGetType(stdlink))
{
/* ... */
}
/* ... */
}