<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello Adrien,<br>
<br>
Le 04/01/2013 14:16, Adrien Vogt-Schilb a écrit :<br>
</div>
<blockquote cite="mid:50E6D615.70304@centre-cired.fr" type="cite"> <tt><br>
<br>
i'd like to call a function inside myscript.sce which would
return the line in the file myscript.sce where the function is
called.<br>
Does that exist?<br>
</tt></blockquote>
<tt>Yes, you might use where() inside the function which calls must
be located:<br>
</tt><br>
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(176,24,19);"><font color="#000000">// script testy_foo.sce
</font>function</span> <span style="color:rgb(131,67,16);font-weight:bold;">Ln</span><span style="color:rgb(92,92,92);"> = </span><span style="color:rgb(0,51,153);">foo</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">b</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">2</span>
<span style="color:rgb(74,85,219);">[</span><span style="color:rgb(131,67,16);font-weight:bold;">Ln</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">F</span><span style="color:rgb(74,85,219);">]</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">where</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(131,67,16);font-weight:bold;">Ln</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(131,67,16);font-weight:bold;">Ln</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(255,170,0);">$</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(176,24,19);">endfunction</span>
<span style="color:rgb(0,0,0);">a</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(50,185,185);">disp</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,51,153);">foo</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)
</span></pre>
<tt>Best wishes for 2013!<br>
</tt><tt>Samuel<br>
<br>
</tt>
</body>
</html>