<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 11/05/2015 16:26, Piotr Grudzinski a
écrit :<br>
</div>
<blockquote
cite="mid:CACGRwV2ejjJU=VebgOQg0qN+Ci5=gQzK3EUVgRSv7r=_5JVf_g@mail.gmail.com"
type="cite">
<pre wrap="">Hello all,
There is a file attached to this email to demonstrates the problem.
The callback of the second button calls test_linspace() and there is no problem.
The callback of the first button calls rb_selected() which then calls
test_linspace() and the following error is generated:
button 1
!--error 21
Invalid index.
at line 22 of function linspace called by :
at line 2 of function test_linspace called by :
at line 7 of function rb_selected called by :
allbackobject(225);rb_selected(1);if exists("%oldgcbo") then gcbo
while executing a callback
Am I doing something wrong?</pre>
</blockquote>
Your problem is due to the type function redefinition<br>
the rb_selected function should be written as follow<br>
<br>
function rb_selected(typ)<br>
if (typ == 1) then<br>
disp('button 1');<br>
else<br>
disp('button 2');<br>
end<br>
test_linspace();<br>
endfunction<br>
<br>
<blockquote
cite="mid:CACGRwV2ejjJU=VebgOQg0qN+Ci5=gQzK3EUVgRSv7r=_5JVf_g@mail.gmail.com"
type="cite">
<pre wrap="">
Regards,
Piotr
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<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>