Giter Site home page Giter Site logo

Comments (5)

dlwicksell avatar dlwicksell commented on May 31, 2024

lothar-joeckel:

First a question, are you using the latest version of Nodem, version 0.3.0? If not upgrade to that, and if so, have you confirmed that everything is set up correctly? Do the other APIs work correctly? For me to test this, I'd need you to send me your code 'run^neo.'

The error you are seeing comes from the JSON parser in Node.js, and means that it isn't valid JSON. I have no problem calling all sorts of different extrinsic functions, with or without arguments, so I'd need your code to debug the issue.

First make sure you are running the latest version, and see if that fixes it. You could run the code in GT.M direct mode first, and show me the output. You can do so like this:

dlw@endor:~/nodem$ mumps -dir

FOIA>w $$function^node("run^neo","9:argument1,4:123")

If you'd like to have me look at this offline, my email address is [email protected].

Thanks for your interest in Nodem, and hopefully we can figure this issue out and get you going again soon.

from nodem.

ljoeckel avatar ljoeckel commented on May 31, 2024

Hello David,

thanks for your fast reply.
I'm running node v0.10.17.

Running from direct mode works as ecpected:
ljoeckel@ubuntu1204:/gtm$ gtm
GTM>w $$function^node("run^neo","9:argument1,4:123")
{"ok": 1, "function": "run^neo", "arguments": [argument1,123], "result": "^ARG(1)=argument1 ^ARG(2)=123"}
GTM>

ljoeckel@ubuntu1204:/gtm$ node test.js
{ ok: 1,
function: 'version^node',
result: 'Node.js Adaptor for GT.M: Version: 0.3.0 (FWSLC); GT.M V6.0-003 Linux x86_64' }

SyntaxError: Unexpected token a
at Object.parse (native)
at Object. (/gtm/test.js:7:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
ljoeckel@ubuntu1204:/gtm$

test.js:
var gtm = require("/gtm/lib/mumps");
var db = new gtm.Gtm();
var ret;
db.open();
var version = db.function({function: 'version^node'});
console.log(version);
ret = db.function({function: 'run^neo',arguments: ['argument1',123]});
console.log("ret=" + JSON.stringify(ret));
db.close();

neo.m:
run(arg1,arg2)
set ^ARG(1)=arg1
set ^ARG(2)=arg2
quit "^ARG(1)="^ARG(1)" ^ARG(2)="_^ARG(2)

Hope this helps. If you can confirm that this will run in your environment then there must be a setup problem in my environment.

Kind regards
Lothar

from nodem.

dlwicksell avatar dlwicksell commented on May 31, 2024

Lothar,

This is a bug in the newest version of Nodem. I know exactly what the problem is, but unfortunately, I am going to be driving all day today, so I can't fix it right now. I should have a new version with a fix for this bug out tomorrow I hope. In the meantime, if you have to, you could go back to the previous version of Nodem, 0.2.1, as it might not have this bug.

I'm sorry about the inconvenience. Again, thanks for your interest in Nodem, and for your patience while I fix this bug.

from nodem.

lothar-joeckel avatar lothar-joeckel commented on May 31, 2024

Hi David,

thank you very much for your enthusasm. This sounds good.
I am very interested in using GT.M together with nodem/node.js.
So will wait for your fix.

Again, thanks a lot for your help.

Kind regards
Lothar

2013/8/28 David Wicksell [email protected]

Lothar,

This is a bug in the newest version of Nodem. I know exactly what the
problem is, but unfortunately, I am going to be driving all day today, so I
can't fix it right now. I should have a new version with a fix for this bug
out tomorrow I hope. In the meantime, if you have to, you could go back to
the previous version of Nodem, 0.2.1, as it might not have this bug.

I'm sorry about the inconvenience. Again, thanks for your interest in
Nodem, and for your patience while I fix this bug.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-23413217
.

from nodem.

dlwicksell avatar dlwicksell commented on May 31, 2024

I have pushed out version 0.3.1, which I believe has fixed the bug that you uncovered.

from nodem.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.