LinkWrite

LinkWrite[link,expr]

writes expr to the specified WSTP connection.

Details

  • 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.

Examples

Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

Read the first packet:

Write the expression 2+2 to the link without evaluating it:

Read the result:

Close the link:

Wolfram Research (1996), LinkWrite, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkWrite.html.

Text

Wolfram Research (1996), LinkWrite, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkWrite.html.

CMS

Wolfram Language. 1996. "LinkWrite." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LinkWrite.html.

APA

Wolfram Language. (1996). LinkWrite. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinkWrite.html

BibTeX

@misc{reference.wolfram_2024_linkwrite, author="Wolfram Research", title="{LinkWrite}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/LinkWrite.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_linkwrite, organization={Wolfram Research}, title={LinkWrite}, year={1996}, url={https://reference.wolfram.com/language/ref/LinkWrite.html}, note=[Accessed: 22-November-2024 ]}