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))
{
/* ... */
}
/* ... */
}