[Scilab-users] Running an .sce from the command line.

Samuel Gougeon sgougeon at free.fr
Thu Mar 31 21:09:20 CEST 2016


Hello,

Le 31/03/2016 20:35, scilab.20.browseruk at xoxy.net a écrit :
> Hi,
>
> I can run my .sce file which produces a graph from a file of data from the (windows) command line using:
>
>      scilex -f myscript.sce filename.rdat
>
> and that works except:
>
> Once the plot() executes and the graphic window appears, control and focus returns to the interactive command line.
Scilab's console, i guess not the shell terminal.

> That's okay; but it'd would be really nice if the focus remained on the graphic window until it was closed and then the scilab shell exited automatically.
Graphics are not modal: AFAIK it is not possible to lock the console 
with a figure until the figure is closed (or until any other event)(you 
could use a for loop waiting for an event ; but it won't reject CTRL-C 
interruptions).
However, to close automatically Scilab when the figure is closed, you 
may add the following in your script:
gcf().closerequestfcn="exit(0)";

HTH
Samuel




More information about the users mailing list