({{, (RefLink[TextPacket, paclet:ref/TextPacket])[string] 
is a WSTP packet containing string, the text output from the Wolfram System as produced by functions such as (RefLink[Print, paclet:ref/Print]).}})

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

link=LinkLaunch[First[$CommandLine] <> " -wstp"]

Read the first packet:

LinkRead[link]

Write a packet representing the text to enter:

LinkWrite[link,EnterTextPacket["Print[2]"]]

The result from the evaluation is a (RefLink[TextPacket, paclet:ref/TextPacket]):

LinkRead[link]

Close the link:

LinkClose[link]

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP and External Program Communication, paclet:tutorial/WSTPAndExternalProgramCommunicationOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[WSTP Packets, paclet:guide/WSTPPackets])}})}})