MLPutUTF32String()

int MLPutUTF32String(MLINK link, const unsigned int *s, int len)
長さlen のUTF-32文字列s を,link で指定されたMathLink 接続に置く.

詳細詳細

  • MLPutUTF32String()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
  • MLError()を使うと,MLPutUTF32String()が不成功の場合にエラーコードを引き出すことができる.
  • MLPutUTF32String()MathLink ヘッダファイルmathlink.hの中で宣言される.

例題例題すべて開くすべて閉じる

例 (1)例 (1)

#include "mathlink.h"

/* send the expression N[10/Sin[2]] as a UTF-32 string to a link */

void f(MLINK lp)
{
    unsigned int expr[13];

    expr[1] = 'N';
    expr[2] = '[';
    expr[3] = '1';
    expr[4] = '0';
    expr[5] = '/';
    expr[6] = 'S';
    expr[7] = 'i';
    expr[8] = 'n';
    expr[9] = '[';
    expr[10] = '2';
    expr[11] = ']';
    expr[12] = ']';

    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(! MLPutUTF32String(lp, (const unsigned int *)expr, 13))
        { /* 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 */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »