• YottaDB. How to call M routines from a GUI/external application?

    From K.S. Bhaskar@21:1/5 to Leonardo Espinosa on Sat Sep 19 07:37:23 2020
    On Saturday, September 19, 2020 at 10:17:32 AM UTC-4, Leonardo Espinosa wrote:
    This is a question I've already seen in this group in the past in 2004 and I'd like to know if there is an updated answer for it.
    I would like to know what is the method by which a GUI or console application can access/run MUMPS routines.
    In this case I'm starting to work on YottaDB and MUMPS digging in its documentation and I still don't see any clear example on how to do it.
    I want to do it with YottaDB because of its FOSS philosophy and I'd like to keep playing, investigating and working with it.
    Sorry if I missed it and please point me in the right direction with a link, book, article, ...
    The language I'm using for this external application is Rust, and more specifically I'm experimenting with Webassembly.

    Any suggestions, links, articles, books, ... are appreciated.

    Thank you in advance for your time and support with this request.
    Leo

    Leo –

    If you're using YottaDB, just use the yottadb crate (https://yottadb.gitlab.io/Lang/YDBRust/yottadb/index.html). If that does not meet your needs, or you run into any problems, please create an Issue at https://gitlab.com/YottaDB/Lang/YDBRust/-/issues

    Regards
    – Bhaskar

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Leonardo Espinosa@21:1/5 to All on Sat Sep 19 07:17:30 2020
    This is a question I've already seen in this group in the past in 2004 and I'd like to know if there is an updated answer for it.
    I would like to know what is the method by which a GUI or console application can access/run MUMPS routines.
    In this case I'm starting to work on YottaDB and MUMPS digging in its documentation and I still don't see any clear example on how to do it.
    I want to do it with YottaDB because of its FOSS philosophy and I'd like to keep playing, investigating and working with it.
    Sorry if I missed it and please point me in the right direction with a link, book, article, ...
    The language I'm using for this external application is Rust, and more specifically I'm experimenting with Webassembly.

    Any suggestions, links, articles, books, ... are appreciated.

    Thank you in advance for your time and support with this request.
    Leo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Irwin@21:1/5 to All on Sun Sep 20 07:02:07 2020
    Leo,

    The following is a very simple method to call a GT.m or YottaDB routine from node.js.

    It works generally like calling GT.m or YottaDB from a shell script.
    Setting up the environment variables, then calling MUMPS and ROUTINE with: mumps -run INDEX^WBDICT

    What the MUMPS ROUTINE Writes gets sent to stdout and displayed on the web page.
    ----------------------------------------

    var express = require("express");
    var app = express();
    var exec = require("child_process").exec;

    process.chdir('/home/biskate/wbdict');
    process.env.gtm_dist = '/usr/lib/fis-gtm/V63012';
    process.env.gtmroutines = './(./) /usr/lib/fis-gtm/V63012'; process.env.gtmgbldir = './gtm.gld';
    process.env.PATH = process.env.PATH + ':/usr/lib/fis-gtm/V63012';

    app.get('/index', function (request, response) { index(request, response); });

    var server = app.listen(8081, function(){ console.log(Date() + ": Server has started."); });

    // Function to Call a M Routine through the Linux shell.
    // To display the index web page.
    function index(request, response)
    {
    cmdLine = "mumps -run INDEX^WBDICT";
    exec(cmdLine, {maxBuffer: 1024 * 3000}, function(error, stdout, stderr)
    {
    response.writeHead(200, {"Content-Type": "text/html"});
    response.write(stderr);
    response.write(stdout);
    response.end();
    });
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Leonardo Espinosa@21:1/5 to All on Sun Sep 20 10:08:19 2020
    Thank you for your replies.
    I think I have a good starting point to work on a solution/example.

    Leo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From winfried.bantel@e-ntwicklung.de@21:1/5 to All on Tue Sep 29 06:24:11 2020
    Hello Leonardo!

    Can You do HTTP-Requests? In this cas you'll have a modern client-server-solution. You can try my FastCGI-Backend
    which connects YottaDB to HTTP.


    https://github.com/informatik-aalen/FastCGI-for-YottaDB

    Samples included.

    Greetings


    Winfried

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick H@21:1/5 to dab...@gmail.com on Sun Aug 1 00:57:44 2021
    On Saturday, September 19, 2020 at 7:17:32 AM UTC-7, dab...@gmail.com wrote:
    This is a question I've already seen in this group in the past in 2004 and I'd like to know if there is an updated answer for it.
    I would like to know what is the method by which a GUI or console application can access/run MUMPS routines.
    In this case I'm starting to work on YottaDB and MUMPS digging in its documentation and I still don't see any clear example on how to do it.
    I want to do it with YottaDB because of its FOSS philosophy and I'd like to keep playing, investigating and working with it.
    Sorry if I missed it and please point me in the right direction with a link, book, article, ...
    The language I'm using for this external application is Rust, and more specifically I'm experimenting with Webassembly.

    Any suggestions, links, articles, books, ... are appreciated.

    Thank you in advance for your time and support with this request.
    Leo
    What's it worth to have one? $5, $10 ... $50 per copy...
    Am thinking about providing a GUI capability for Mumps users. The question is: Will anyone pay for it?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)