IMathLink.PutNext Method

Parameters

type

The type of expression you will be sending.

Remarks

PutNext is rarely needed. The two most likely uses are to put expressions whose heads are not mere symbols (e.g., Derivative[2][f]), or to put data in so-called "textual" form. Calls to PutNext must be followed by PutSize and PutData, or by PutArgCount for the ExpressionType.Function type.

Here is how you could send Derivative[2][f]:

ml.PutNext(ExpressionType.Function); // The func we are putting has head Derivative[2], arg f
ml.PutArgCount(1); // this 1 is for the 'f'
ml.PutNext(ExpressionType.Function); // The func we are putting has head Derivative, arg 2
ml.PutArgCount(1); // this 1 is for the '2'
ml.PutSymbol("Derivative");
ml.Put(2);
ml.PutSymbol("f");

Here is an example of sending an integer in "textual" form. This would be useful if you happened to have the digits of the integer in the form of an array of bytes rather than an int type: