IMathLinkPeekExpr Method

Creates an Expr from the current expression, but does not drain it off the link.

Definition

Namespace: Wolfram.NETLink
Assembly: Wolfram.NETLink (in Wolfram.NETLink.dll) Version: 2.0.0.0
C#
Expr PeekExpr()

Return Value

Expr

Remarks

This method is like GetExpr, but PeekExpr does not actually remove anything from the link. In other words, it leaves the link in the same state it was in before PeekExpr was called. It is useful for examining the next expression on the link without actually consuming it. That means you can insert a line like this in your program without disturbing your other code for reading the data:
C#
Console.WriteLine("The next expression is: " + ml.PeekExpr());

Exceptions

MathLinkExceptionOn any MathLink error.

See Also