MoI discussion forum
MoI discussion forum

Full Version: Costa's minimal surface

Show messages: All  1-11  12-13

From: Michael Gibson
28 Oct 2020   [#12] In reply to [#11]
Hi Brian,

re:
> I wonder if this library could be "Included" or linked to in a MoI script?

Hmmm, well the only method that I can think of for that would be to compile the library into its own standalone executable program. A script in MoI could then run the program and pass command line parameters to it and receive any output that the program wrote to stdout.

That can be done by the moi.filesystem.shellExecute method, which as of the Sep-10 v4 beta has a "wait for finished" option in it:

quote:

moi.filesystem.shellExecute(), added wait for finished parameter.
moi.filesystem.shellExecute( path, params, wait ) now takes an optional 3rd boolean parameter for whether to wait until the called process has exited before returning. When used, the return value from shellExecute() is an object containing an .exitCode property for the integer exit code of the called process and an .output string parameter for any text written by the called process to stdout.
Example:
var res = moi.filesystem.shellExecute( 'cmd /c dir c:\\', '', true );
if ( res.output ) moi.ui.alert( res.output );


- Michael
From: bemfarmer
28 Oct 2020   [#13] In reply to [#12]
Michael, thank you for the guidance.

- Brian

Show messages: All  1-11  12-13