[Scilab-users] Invalid index?

Tim Wescott tim at wescottdesign.com
Wed Mar 30 21:52:30 CEST 2016


At the risk of sounding like a theologian, what is god?

On Wed, 2016-03-30 at 05:48 -0800, scilab.20.browseruk at xoxy.net wrote:
> This one has me baffled!
> 
> If I run this code:
> ...
>     god.vars = []; 
> for i=1:11
>     disp(i);
>     god.vars(i)  = 1; // uicontrol( god.frame1, 'style', 'text', 'string', god.labels(i), 'position', [ i*60 - 8 + fudge, 30, 10, 20 ] );
>     ...
> end
> 
> It completes without error.
> 
> But if I uncomment the uicontrol:
> 
>     god.vars(i)  = uicontrol( god.frame1, 'style', 'text', 'string', god.labels(i), 'position', [ i*60 - 8 + fudge, 30, 10, 20 ] );
> 
> The assignment to god.vars(i) works when i == 1;, but fails when i == 2 as follows:
> 
> -->exec('C:\test\poly.sce', -1)
>  
>     1.  
>  
>     2.  
>     god.vars(i)  = uicontrol( god.frame1, 'style', 'text', 'string', god.labels(i), 'position', [ i*60 - 8 + fudge, 30, 10, 20 ] );
>                                                                                                                                    !--error 21 
> Invalid index.
> at line      43 of exec file called by :    
> exec('C:\test\poly.sce', -1)
>  
> I've eliminated the only other index usage (god.labels(i)) as a problem;
> 
> so why can it assign to god,vars(1) and not to god.vars(2)?
> 
> Thanks Buk.
> 
> ____________________________________________________________
> FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
> Check it out at http://www.inbox.com/earth
> 
> 
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 
> 

-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432





More information about the users mailing list