<div>Hello,</div><div><br></div><div>I have one more problem with transfer variables from TCL to Scilab and from Scilab to TCL. In Tcl I have several entries field in which name of variables are nr$i (where $i are following numbers). Example of this function in TCL is below:</div>
<div><br></div><div><i>for {set i 1} {$i <= ($::npkt)} {incr i} {</i></div><div><i>  pack [entry .<a href="http://pol.n.nr">pol.n.nr</a>$i -width 7 -justify right -textvariable nr$i -validate key -vcmd {expr {[string is double %P] && ![string match ""0*"" %P] && [string len %P] <=7}}]</i></div>
<div><i>}</i></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
</blockquote></div><br><div>So if I have <b><i>npkt = 5</i></b> I should have 5 variables call <b>nr1</b>, <b>nr2</b>, <b>nr3</b> i <b>nr4</b>. So I created in Scilab function which should import this variables:</div><div>
<br></div><div><div><i>function []=calc()</i></div><div><i>n=evstr(TCL_GetVar("npkt"));</i></div><div><i>for i=1:n</i></div><div><i>    b ="nr''+string(i)      //name of variables in TCL</i></div><div>
<i>    nr_pkt(i)=evstr(TCL_GetVar("b"));</i></div><div><i>end</i></div><div><i>endfunction</i></div><div><i><br></i></div></div><div>After executed program inScilab and used this finctionI have information:</div>
<div><div><i> !--error 999 </i></div><div><i>TCL_GetVar: Could not read Tcl Variable.</i></div><div><i>at line      14 of function liczpol called by :  </i></div><div><i>liczpol()</i></div><div><i>while executing a callback</i></div>
<div><i><br></i></div><div>Could anyone know what is wrong with this function?</div><div><br></div><div>And I have question about second function which should return calculated variables to TCL. Is this function is write correctly?</div>
<div><div><i>function []=result()</i></div><div><i>n=evstr(TCL_GetVar("nrxp"));</i></div><div><i>for i=1:n</i></div><div><i>  x<span class="Apple-style-span" style="font-style: normal; "><i><div style="display: inline !important; ">
='xp'+string(i)     //name of variables in TCL</div></i></span></i></div><i><div>  <span class="Apple-style-span" style="font-style: normal; "><i><div style="display: inline !important; ">TCL_SetVar("x",r(i))   //r(i) are results</div>
</i></span></div></i><div><i>end</i></div><div><i>endfunction</i></div><div><br></div><div>Could you tell me where is mistake in my function, and what can I do with it to fix it?</div><div>Marcin</div></div></div>