.NET/Link API Version 1.6 USE FRAMES

IMathLink.PutNext Method 

Identifies the type of data element that is to be sent next.

[Visual Basic]
Sub PutNext( _
   ByVal type As ExpressionType _
)
[C#]
void PutNext(
   ExpressionType type
);

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:

byte[] digits = {(byte)'1', (byte)'2', (byte)'3'};
ml.PutNext(ExpressionType.Integer);
ml.PutSize(digits.Length);
ml.PutData(digits);

Exceptions

Exception Type Condition
MathLinkException On any MathLink error.

See Also

IMathLink Interface | Wolfram.NETLink Namespace | PutSize | PutData | PutArgCount