<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
You can use "resume" to return values in caller environment.<br>
In case of callbacks from gui interaction, caller is always
"console" scope.<br>
<br>
In your callback do something like "data = resume(a);"<br>
That's create or overwrite "data" with the contents of "a"<br>
<br>
Example :<br>
<br>
<tt>xdel(winsid());</tt><tt><br>
</tt><tt>clear createGUI callbackFromGui;</tt><tt><br>
<br>
</tt><tt>function createGUI()</tt><tt><br>
</tt><tt> f = figure(...</tt><tt><br>
</tt><tt> "dockable", "off", ...</tt><tt><br>
</tt><tt> "axes_size", [300 100], ...</tt><tt><br>
</tt><tt> "infobar_visible", "off", ...</tt><tt><br>
</tt><tt> "toolbar", "none", ...</tt><tt><br>
</tt><tt> "menubar_visible", "on", ...</tt><tt><br>
</tt><tt> "menubar", "none", ...</tt><tt><br>
</tt><tt> "default_axes", "off", ...</tt><tt><br>
</tt><tt> "background", color(255, 255, 255));</tt><tt><br>
</tt><tt><br>
</tt><tt> uicontrol(f, ...</tt><tt><br>
</tt><tt> "style", "pushbutton", ...</tt><tt><br>
</tt><tt> "string", "Send variable in console context", ...</tt><tt><br>
</tt><tt> "position", [(300 - 200)/2 (100 - 25)/2 200 25],
...</tt><tt><br>
</tt><tt> "callback", "callbackFromGui");</tt><tt><br>
</tt><tt>endfunction</tt><tt><br>
</tt><tt><br>
</tt><tt>function callbackFromGui()</tt><tt><br>
</tt><tt> a = rand(10, 10);</tt><tt><br>
</tt><tt> data = resume(a);</tt><tt><br>
</tt><tt>endfunction</tt><tt><br>
</tt><tt><br>
</tt><tt>createGUI();</tt><br>
<br>
After clicking on the button, you should have a "data" variable in
the console.<br>
<br>
Regards,<br>
Antoine<br>
<br>
<div class="moz-cite-prefix">Le 10/05/2019 à 14:18, Stéphane
Mottelet a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:08d584ba-0a0a-5ed1-ee65-dd1d159adffe@utc.fr">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Le 10/05/2019 à 11:42, Hani Andreas
Ibrahim a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:trinity-35ea743a-30af-415b-befb-c63d66dbfe91-1557481346620@3c-app-gmx-bs07">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<div style="font-family: Verdana;font-size: 12.0px;">
<div>I wrote a SCE-Script where you can read datafiles into a
matrix and specify the import parameter AND the name of
matrix where the data is stored in a GUI. Because variables
in sce are visible to Scilab I could work with the matrix
which name was specified in the GUI in Scilab's console.</div>
<div> </div>
<div>Now I wrote a toolbox where I call this script from a
menu item (addmenu) with exec("myscrip.sce",-1). The toolbox
works fine so far and run the script properly but the matrix
variable is not visible in Scilab. Obviously Scilab handles
variables in sce in a toolbox differently?</div>
<div> </div>
<div>The script itself works fine and provide the variable if
I run the sce directly outside the toolbox. The sce has no
dependencies to external SCIs.</div>
<div> </div>
<div>Who can I make this variable visible for Scilab from a
toolbox?</div>
<div> </div>
<div>Thanks, Hani</div>
<div> </div>
<div>PS: The toolbox should run on Scilab 5.5.x and 6.0.x.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" moz-do-not-send="true">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" moz-do-not-send="true">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<p>Hello,</p>
<p>Please give us a small and reproductive example, under the form
of two scripts (the one creating the menu and the one executed
by selecting the menu item).</p>
<p>S.<br>
</p>
<pre class="moz-signature" cols="72">--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet" moz-do-not-send="true">http://www.utc.fr/~mottelet</a></pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>