ExecScilabCommand
Execute a Scilab from a C/C++ code (call_scilab) and can get message and callstack on error.
int ExecScilabCommand(char* cmd, char** msg, char** stack)
Description
This fonction is provided in call_scilab. This function execute a command by the Scilab engine.
In case of error, it can fill buffers to get error message and/or callstack information.
Arguments
- cmd
a standard C char* containing the Scilab commands
msg
in case of error during execution and if
msg
!= NULL, engine will fill buffer with error messagemsg
must be free.
stack
in case of error during execution and if
stack
!= NULL, engine will fill buffer with callstack informationstack
must be free.- returns
0 if the execution is successful.
-1 if the execution fails.
Examples
// A simple ExecScilabCommand example StartScilab(NULL, NULL, 0); char* errmsg = NULL; char* errstack = NULL; int err = ExecScilabCommand((char*)"cosd(\"a\")", &errmsg, &errstack); if (err) { std::cout << "Msg: " << errmsg << std::endl; std::cout << "Stack: " << errstack<< std::endl; free(errmsg); free(errstack); }
See also
- Call_Scilab — call_scilab is an interface which provides the ability to call Scilab engine from C/C++ code
- Compile and run with call_scilab — How to compile a native application based on or using Scilab
- SendScilabJob — Send a Scilab task from a C/C++ code (call_scilab)
Report an issue | ||
<< DisableInteractiveMode | call_scilab API (Scilab engine) | fromc >> |