|
SOLUTIONS
|
MATHEMATICA MATHLINK C FUNCTION
MLPutUTF16String()
int MLPutUTF16String(MLINK link, const unsigned short *s, int len)
puts a UTF-16 string s of length len to the MathLink connection specified by link.
DetailsDetails
- MLPutUTF16String() determines the number of characters in the string s automatically.
- MLPutUTF16String() returns 0 in the event of an error, and a nonzero value if the function succeeds.
- Use MLError() to retrieve the error code if MLPutUTF16String() fails.
- MLPutUTF16String() is declared in the MathLink header file mathlink.h.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
#include "mathlink.h"
/* send the expression N[10/Sin[2]] to a link */
void f(MLINK lp)
{
unsigned short expr[12];
expr[0] = 'N';
expr[1] = '[';
expr[2] = '1';
expr[3] = '0';
expr[4] = '/';
expr[5] = 'S';
expr[6] = 'i';
expr[7] = 'n';
expr[8] = '[';
expr[9] = '2';
expr[10] = ']';
expr[11] = ']';
if(! MLPutFunction(lp, "EvaluatePacket", 1))
{ /* unable to put the function to lp */ }
if(! MLPutFunction(lp, "ToExpression", 1))
{ /* unable to put the function to lp */ }
if(! MLPutUTF16String(lp, (const unsigned short *)expr, 12))
{ /* unable to put the expression string to lp */ }
if(! MLEndPacket(lp))
{ /* unable to put the end-of-packet indicator to lp */ }
if(! MLFlush(lp))
{ /* unable to flush any outgoing data buffered in lp */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
