LinkWrite

LinkWrite[link,expr]
writes expr to the specified WSTP connection.

DetailsDetails

  • link must be an active LinkObject, as returned by functions like LinkLaunch or Links.
  • You can use LinkWrite[link,Unevaluated[expr]] to write expr to the link without evaluating it.
  • The head of expr will often be a packet that specifies how expr should be processed by the program which receives it.
  • When LinkWrite is used to send data to a Wolfram Language kernel, EnterTextPacket["string"] enters the text of an input line, and EvaluatePacket[expr] sends an expression for evaluation.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

In[1]:=
Click for copyable input
Out[1]=

Read the first packet:

In[2]:=
Click for copyable input
Out[2]=

Write the expression to the link without evaluating it:

In[3]:=
Click for copyable input

Read the result:

In[4]:=
Click for copyable input
Out[4]=

Close the link:

In[5]:=
Click for copyable input
Introduced in 1996
(3.0)