__system3
Syntax
__system3(string, &output, &error)
Parameters
stringThe command line used to start an external application. In some cases, the full path is needed. If it contains space characters, quotation marks escaped with backslashes (
\") can be added to encapsulate the path, and, separately, the arguments to the application, like this:"\"D:\\My projects\\my app\\app.exe\" \"some argument\"".
outputThe output returned from the
stdoutoutput stream of the application.
errorThe output returned from the
stderroutput stream of the application.
Return value
The exit code returned from the external application. If the application could not be launched or fails to return an appropriate exit code, 1 is returned.
For use with
All C-SPY drivers.
Description
This macro launches an external application. The output from the stdout stream is stored in output and the stderr stream is stored in error. If no data has been received from the launched application within the timeout setting, or when the returned data exceeds the maximum data setting, the application is terminated. This restriction prevents the Embedded Workbench IDE from freezing or crashing because of misbehaving applications. By default, the timeout setting is 10 seconds, and the maximum data setting is 65,535 bytes.
Example
__var exitCode;
__var out;
__var err;
exitCode = __system3("dir /S", &out, &err);
__message "Output from the dir command:";
__message out;
__message "Error text from the dir command:";
__message err;__setSystemTimeout, __setSystemMaxData, __system1, and __system2.