MLTransferToEndOfLoopbackLink()

int MLTransferToEndOfLoopbackLink(MLINK d, MLINK s)
把回环链接 s 中的完整内容传递到目标链接 d.

更多信息更多信息

  • sd 应该是不同的.
  • s 必须是回环链接,d 可以是回环链接或一个普通链接.
  • MLTransferToEndOfLoopbackLink() 在错误事件中返回0,如果函数成功则返回非零值.
  • MLTransferToEndOfLoopbackLink()MathLink 的标头文件 mathlink.h 中被声明.

范例范例打开所有单元关闭所有单元

基本范例 (1)基本范例 (1)

#include "mathlink.h"

/* build up an expression on a loopback link and send that expression to a second link */

void f(MLINK lp1, MLINK lp2)
{
    if(! MLPutFunction(lp1, "EvaluatePacket", 1))
        { /* unable to put the function to lp1 */ }

    if(! MLPutFunction(lp1, "ToExpression", 1))
        { /* unable to put the function to lp1 */ }

    if(! MLPutString(lp1, "a = Table[Random[Integer, 11],{12}];", 36))
        { /* unable to put the string to lp1 */ }

    if(! MLEndPacket(lp1))
        { /* unable to send the end-of-packet indicator to lp1 */ }

    if(! MLFlush(lp1))
        { /* unable to flush any outgoing data buffered in lp1 */ }

    if(! MLTransferToEndOfLoopbackLink(lp2, lp1))
        { /* unable to transfer all the data from lp1 to lp2 */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »