<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Here is a small example. Although the name of fields of returned
struct is very cryptic, the information you need can be easily
recovered.<br>
</p>
<p><br>
</p>
<pre style="font-family:Monospaced;font-style:normal;font-size:15.0;"><span style="color:rgb(50,185,185);">mputl</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">function [y] = foo(x)</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">y = x + a</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">y = y + b</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">endfunction</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">slint_test.sci</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">
out</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">slint</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">slint_test.sci</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(218,112,214);">%f</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(160,32,240);">
if</span> <span style="color:rgb(50,185,185);">isfield</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">out</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">info</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">00003.Uninitialized</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">s</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">out</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">info</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">00003.Uninitialized</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">i</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(50,185,185);">length</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">s</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">disp</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">s</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">msg</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(160,32,240);">end</span>
<span style="color:rgb(160,32,240);">end
</span></pre>
<div class="moz-cite-prefix">S.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Le 07/05/2020 à 14:40, Stéphane
Mottelet a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:610c3659-effb-4207-1a0f-50cdd20cd2ac@utc.fr">Hi,
<br>
<br>
Use Scilab slint tool:
<br>
<br>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/help.scilab.org/docs/6.1.0/en_US/slint.html">https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/help.scilab.org/docs/6.1.0/en_US/slint.html</a>
<br>
<br>
S.
<br>
<br>
Le 07/05/2020 à 14:01, kjubo a écrit :
<br>
<blockquote type="cite">Dear all,
<br>
<br>
I would like to ask you, how can I disable visibility of
variables from
<br>
workspace for functions.
<br>
<br>
I need to be sure, that function which I convert from script
file, will not
<br>
use any variable, which is not in it input, or defined inside
the function
<br>
itself.
<br>
<br>
Please see examples below.
<br>
<br>
Is this possible?
<br>
Thank you
<br>
BR
<br>
JK
<br>
<br>
example 1:
<br>
<br>
a = 3
<br>
function fx = some_fun(x,a)
<br>
fx = x+a
<br>
endfunction
<br>
<br>
calling some_fun(5) now return 3+5, but I need to be an
error.
<br>
<br>
<br>
example 2:
<br>
<br>
a = 3
<br>
function fx = some_fun(x)
<br>
fx = x+a
<br>
endfunction
<br>
<br>
I need also error, as variable a should be passed as
input argument
<br>
or defined inside some_fun body
<br>
<br>
<br>
<br>
--
<br>
Sent from:
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html</a><br>
_______________________________________________
<br>
users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
<br>
</blockquote>
<br>
</blockquote>
<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">http://www.utc.fr/~mottelet</a>
</pre>
</body>
</html>