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


Groups > comp.lang.javascript > #34615

Re: DATA Structure one last time

X-Received by 10.36.28.11 with SMTP id c11mr3465964itc.41.1516534515913; Sun, 21 Jan 2018 03:35:15 -0800 (PST)
X-Received by 10.157.43.61 with SMTP id o58mr187475otb.10.1516534515786; Sun, 21 Jan 2018 03:35:15 -0800 (PST)
Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!g80no1456820itg.0!news-out.google.com!b73ni5181ita.0!nntp.google.com!g80no1456815itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.javascript
Date Sun, 21 Jan 2018 03:35:15 -0800 (PST)
In-Reply-To <a111ab7e-9e84-419f-af37-cb227a23a66d@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=83.226.192.38; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host 83.226.192.38
References <7fc77627-cbc4-4427-83f7-74dc5e8b0123@googlegroups.com> <a111ab7e-9e84-419f-af37-cb227a23a66d@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <b8a8ec79-ae86-40ad-bc90-aec2a72af2c8@googlegroups.com> (permalink)
Subject Re: DATA Structure one last time
From Jonas Thörnvall <jonas.thornvall@gmail.com>
Injection-Date Sun, 21 Jan 2018 11:35:15 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 49
Xref csiph.com comp.lang.javascript:34615

Show key headers only | View raw


Den söndag 21 januari 2018 kl. 11:09:44 UTC+1 skrev Jonas Thörnvall:
> Den söndag 21 januari 2018 kl. 10:50:48 UTC+1 skrev Jonas Thörnvall:
> > function newTrack(m) {
> >    track[m] ={
> >      outport:[],
> >      portname : [],
> >      midichannel:[],
> >      program:[],
> >      midiMess:[{time:0,data0:0,data1:0,data2:0}]
> >    };
> >     return track;
> > }
> > 
> > function makeTrack() {
> >     for (var m = 0; m < 101; m ++ ){
> >    	  newTrack(m);
> >     }
> > 
> >     makeMidiMessages();
> > }
> > 
> > function makeMidiMessages(){
> >     for (var m = 0; m<101; m++) {
> >        for (var n=0;n<10000;n++){
> >           track[m].midiMess[n];
> >        }
> >     }
> >   //HOW CAN POSSIBLY THIS LINE PASS???????????????
> >   track[0].midiMess[0].time=100;
> >   //BUT NOT THIS ONE????????????????????????
> >   track[0].midiMess[1].time=100;
> >   console.log(track[0].midiMess[0].time);
> > }
> 
> It is strange things like this that make me suspect i do not understand what the syntax of the structure i create mean.
> 
> 
> 
> I thought i have an array track that have another array midiMess as property. And that the midimess array also has properties that is why an assign like this should work. Once you created tracks and midimessages, but that is not the case.
> 
> So is it all misunderstood?

Well i see now why i can access the first, it is created each time is created in the template "prototype".

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


Thread

DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-21 01:50 -0800
  Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-21 02:09 -0800
    Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-21 03:35 -0800
      Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-21 04:10 -0800
        Re: DATA Structure one last time John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-21 18:04 +0000
          Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-21 20:03 -0800
            Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-21 20:07 -0800
            Re: DATA Structure one last time John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-22 10:47 +0000
              Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-22 04:32 -0800
                Re: DATA Structure one last time John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-22 16:32 +0000
                Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-22 21:36 -0800
                Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-23 01:22 -0800
                Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-23 05:18 -0800
                Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-23 05:38 -0800
                Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-23 05:44 -0800
                Re: DATA Structure one last time Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-23 06:07 -0800

csiph-web