Simple MathLink question
- To: mathgroup at smc.vnet.net
- Subject: [mg14690] Simple MathLink question
- From: Jim McGuire <jimm at opticalres.com>
- Date: Sun, 8 Nov 1998 21:15:48 -0500
- Organization: Optical Research Associates
- Sender: owner-wri-mathgroup at wolfram.com
I am trying to read in a set of Mathematica definitions which was saved
using DumpSave["MathLink_USER.mx",{function1,function2,...}] from
D:\jimm\svgcn018 directory on my NT PC. I have been unsuccessful
reading it into the MathLink session. The definitions are very long
and I do not relish the thought of importing them using MLPut commands.
I tried the following test to see if the link is open. It shows the
proper data is ready to be read by the link
MLPutFunction(stdlink,"EvaluatePacket",1);
MLPutFunction(stdlink,"Plus",2);
MLPutReal(stdlink,2.1)
MLPutInteger(stdlink,2);
MLEndPacket(stdlink);
printf("MLReady = %d\n",MLReady(stdlink));
However when I try the following, it shows that there is no data to be
read on the stdlink and subsequent attempts to read data hang.
MLPutFunction(stdlink,"EvaluatePacket",1);
MLPutFunction(stdlink,"Get",1);
MLPutString(stdlink,"\"D:\\jimm\\svgcn018\\MathLink_USERSUR.mx\"");
MLEndPacket(stdlink);
printf("MLReady = %d\n",MLReady(stdlink));
I have tried issuing Get["D:\jimm\svgcn018\MathLink_USERSUR.mx"] from
within Mathematica and it works fine. The desired functions are
loaded.
Many thanks in advance for any assistance.
Jim