Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23799

Re: Does an array have to be reinitialised when one precreate space, if so how?

Newsgroups comp.lang.javascript
Date 2014-04-05 14:20 -0700
References <cb9b8034-af8f-4663-b768-70a6ea1fb9c1@googlegroups.com>
Message-ID <deb4cb27-ed25-4641-b346-3af04cfd5f38@googlegroups.com> (permalink)
Subject Re: Does an array have to be reinitialised when one precreate space, if so how?
From jonas.thornvall@gmail.com

Show all headers | View raw


Den lördagen den 5:e april 2014 kl. 23:11:22 UTC+2 skrev jonas.t...@gmail.com:
> I have this function that is used onload, when i call it again the scope have changed by user input and therefore the arrasize should change. But i can not see it happen in the output? Is it not possible to add objects in both ends of array extending it?
> 
> 
> 
> The function is called from reinitialise(); And there the scope is changed.
> 
> Function automaticly adds +-10000 to start and range for the animation and stepping. 
> 
> 
> 
> But changing the natural min max should, setting scope should change arraysize or?
> 
> 
> 
> file:///C:/Users/jonas/Desktop/prime0.993/div.html
> 
> 
> 
> function arraysize()
> 
> {
> 
>    
> 
>    for ( i = -scope; i <= scope; i ++ )
> 
>    { 
> 
>       arr[i] =
> 
>       {
> 
>          count : i,
> 
>          fcolor : 'black',
> 
>          rheight : 100,
> 
>          rwidth : 100,
> 
>          rcolor : 'white',
> 
>          prime : true
> 
>       }
> 
>    }
> 
> }

Ok it is possible to add  index in the positive direction of array however extending the array in the negative direction do not work at all. Kind of weird, but on the other side someone told me negative indexes should not work at all?

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Does an array have to be reinitialised when one precreate space, if so how? jonas.thornvall@gmail.com - 2014-04-05 14:11 -0700
  Re: Does an array have to be reinitialised when one precreate space, if so how? jonas.thornvall@gmail.com - 2014-04-05 14:12 -0700
  Re: Does an array have to be reinitialised when one precreate space, if so how? jonas.thornvall@gmail.com - 2014-04-05 14:20 -0700
    Re: Does an array have to be reinitialised when one precreate space, if so how? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-04-06 09:27 +0200
      Re: Does an array have to be reinitialised when one precreate space, if so how? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-04-07 17:30 -0700
        Re: Does an array have to be reinitialised when one precreate space, if so how? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-04-07 23:34 -0700
        Re: Does an array have to be reinitialised when one precreate space, if so how? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-04-08 22:17 +0200
          Re: Does an array have to be reinitialised when one precreate space, if so how? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-04-08 17:01 -0700
            Re: Does an array have to be reinitialised when one precreate space, if so how? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-04-09 09:22 +0200
  Re: Does an array have to be reinitialised when one precreate space, if so how? jonas.thornvall@gmail.com - 2014-04-05 14:21 -0700
  Re: Does an array have to be reinitialised when one precreate space, if so how? jonas.thornvall@gmail.com - 2014-04-05 14:24 -0700

csiph-web