generates an executable script.exe file from a Scilab script.sce
[output, OK, exitCode] = scetoexe(scriptSCE, outDir, devenvPath, cleanTMPdir)
string providing the path+filename of the *.sce Scilab script to be processed.
string providing the path of the directory where the final script.exe
must be stored. By default, the directory where
scriptSCE
stands is considered. This directory must be
writable. Use "" to skip it (and then use the default).
string providing the path+filename of the devenv.exe program of the Visual
Studio C compiler installed on your computer. This is required when
haveacompiler()
returns %F despite a Visual Studio
compiler is actually installed, including the devenv.exe program required by
scetoexe()
. "devenv"
(with no path)
is the default value, that may be used to skip it.
boolean (default = %t). If it is set to %F, then the set of C-compilable files copied in the TMPDIR/scripSCEname subdirector to build the .exe are left, instead of being removed. When the build fails, error logs from the compiler may be also present in this directory.
Column of text: output returned by Windows after calling the devenv compiler.
Boolean: %T if the devenv compiler has been actually called, and Windows has understood the call without error. %F otherwise.
Exit code returned by the MS Windows shell when calling the compiler.
scetoexe()
tries to build an executable file.exe from the input script file
written in Scilab language.
![]() |
|
A compilable set of files is created in the TMPDIR\scriptName
each time
scetoexe() is run. If this directory already exists, it is automatically deleted and then
recreated.
// Display the demo sample file in console: script = scetoexe_getRootPath() + "\demos\example.sce"; f = mgetl(script); write(%io(2), f); // Find the C compiler: if ~isdef("devenv","l") & (~haveacompiler() | findmsvccompiler()=='unknown') devenv = uigetfile("*.exe","","Please select the ""devenv.exe"" compiler program"); end if devenv==[] devenv = "devenv" end // We will store the .exe in TMPDIR // Now build the .exe, and do not remove compilation files: [output, OK, exitCode] = scetoexe(script, TMPDIR, devenv, %f) // Finally: start the .exe if OK [a,b,c] = dos("start """+TMPDIR+"\example.exe""") else cd(TMPDIR) end | ![]() | ![]() |
--> // Display the demo sample file in console: --> script = scetoexe_getRootPath() + "\demos\example.sce"; --> f = mgetl(script); --> write(%io(2), f); // scetoexe module for Scilab // Allan CORNET - 2010 // // example script for scetoexe disp("Hello from a .sce"); A = rand(5, 3); mprintf("A = "); disp(A); C = A' * A; disp("C = A'' * A ="); disp(C); beep(); plot2d(); input("Press RETURN", "s"); --> // Find the C compiler: --> if ~isdef("devenv","l") & (~haveacompiler() | findmsvccompiler()=='unknown') > devenv = uigetfile("*.exe","","Please select the ""devenv.exe"" compiler program"); > end --> if devenv==[] > devenv = "devenv" > end --> [output, OK, exitCode] = scetoexe(script, TMPDIR, devenv, %f) Please wait while building the .exe... Done exitCode = 0. OK = T output = []
Version | Description |
0.2 |
|