MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

How to get last input line in MathLink mode?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116514] How to get last input line in MathLink mode?
  • From: Alexey <lehin.p at gmail.com>
  • Date: Thu, 17 Feb 2011 05:38:44 -0500 (EST)

Hello,

Is there a way to get the last input line through MathLink? I tried to
send InString[-1] through MathLink but I get no output. Is InString[]
unsupported in MathLink mode?

link = LinkLaunch[First[$CommandLine] <> " -mathlink"];
Print@LinkRead[link]
LinkWrite[link, Unevaluated[EnterExpressionPacket[2 + 2]]]
Do[Print@LinkRead[link], {3}]
LinkWrite[link, Unevaluated[EnterExpressionPacket[InString[-1]]]]
Do[Print@LinkRead[link], {1}]

InputNamePacket[In[1]:= ]

OutputNamePacket[Out[1]= ]

ReturnExpressionPacket[4]

InputNamePacket[In[2]:= ]

InputNamePacket[In[3]:= ]


  • Prev by Date: Virtual Memory Problem
  • Next by Date: Re: Another point about Mathematica 8.0
  • Previous by thread: Virtual Memory Problem
  • Next by thread: Re: How to get last input line in MathLink mode?