MLNextPacket()

int MLNextPacket(MLINK link)
进入 link 中下一个包并返回一个常量表明它的标头.

更多信息更多信息

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

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

#include "mathlink.h"

/* read the type of the incoming packet on a link */

void f(MLINK lp)
{
    switch(MLNextPacket(lp))
    {
        case CALLPKT:
            /* read the CallPacket[] */
            break;
        case EVALUATEPKT:
            /* read the EvaluatePacket[] */
            break;
        case RETURNPKT:
            /* read the EvaluatePacket[] */

        /* ... */

        case ILLEGALPKT:
            /* unable to read the next packet from lp */
    }    
}
New to Mathematica? Find your learning path »
Have a question? Ask support »