PacketType WaitForAnswer()
Function WaitForAnswer As PacketType
PacketType WaitForAnswer()
abstract WaitForAnswer : unit -> PacketType
Use this method after sending an expression to evaluate with Evaluate(String) or a manual sequence of Put methods.
ml.Evaluate("2+2");
ml.WaitForAnwser();
int result = ml.GetInteger();
// It is not strictly necessary to call newPacket, since we have read the entire packet contents, but it is good style.
ml.NewPacket();
It returns the packet type that held the result of the computation. Typically, this will be PacketType.Return. However, in the unlikely event that you are manually sending evaluations inside an EnterTextPacket or EnterExpressionPacket, the packet will be different, and there are some further issues that you need to understand; consult the .NET/Link User Guide for details.
MathLinkException | On any MathLink error. |