This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

LinkRead

LinkRead[link]
reads one expression from the specified MathLink connection.
LinkRead[link, h]
wraps h around the expression read before evaluating it.
  • LinkRead will wait until it has read a complete expression before returning.
  • You can test whether an expression is ready to be read from a particular link using LinkReadyQ.
  • You can use LinkRead[link, Hold] to get an expression from a link without evaluating it.
Launch a subsidiary Mathematica kernel process:
Read the first packet:
Write a packet to enter 10!:
Read a packet representing the output prompt:
Read the actual result from the computation:
Close the link:
Launch a subsidiary Mathematica kernel process:
In[1]:=
Click for copyable input
Out[1]=
Read the first packet:
In[2]:=
Click for copyable input
Out[2]=
Write a packet to enter 10!:
In[3]:=
Click for copyable input
Read a packet representing the output prompt:
In[4]:=
Click for copyable input
Out[4]=
Read the actual result from the computation:
In[5]:=
Click for copyable input
Out[5]=
Close the link:
In[6]:=
Click for copyable input
New in 3