MLPutArgCount()

int MLPutArgCount(MLINK link, int n)
指定放在 link 中一个复合函数的自变量数.

更多信息更多信息

  • MLPutArgCount() 在错误事件中返回0,如果函数成功则返回非零值.
  • 如果 MLPutArgCount() 失败,则使用 MLError() 检索错误代码.
  • MLPutArgCount()MathLink 标头文件 mathlink.h 中被声明.

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

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

#include "mathlink.h"

/* send Plus[2,3] over a link */

void f(MLINK lp)
{
    if(! MLPutType(lp, MLTKFUNC))
        { /* unable to send the function type to lp */ }

    if(! MLPutArgCount(lp, 2))
        { /* unable to put the number of arguments to lp */ }

    if(! MLPutSymbol(lp, "Plus"))
        { /* unable to put the symbol to lp */ }

    if(! MLPutInteger(lp, 2))
        { /* unable to put the integer to lp */ }

    if(! MLPutInteger(lp, 3))
        { /* unable to put the integer to lp */ }

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

    if(! MLFlush(lp))
        { /* unable to flush the link-output buffer */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »