Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #30508
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2016-05-22 03:50 -0700 |
| References | <89e1dd41-b971-4f04-aad2-e726abe20d56@googlegroups.com> <nhqrh5$drt$1@dont-email.me> <377a7af5-a75b-4ec0-93a6-32daa95b2129@googlegroups.com> |
| Message-ID | <7061f6e1-cedb-42ab-b41b-e162133f4939@googlegroups.com> (permalink) |
| Subject | Re: Layered object |
| From | jonas.thornvall@gmail.com |
Den söndag 22 maj 2016 kl. 08:42:41 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 22 maj 2016 kl. 01:41:58 UTC+2 skrev Aleksandro:
> > On 21/05/16 13:41, jonas.thornvall@gmail.com wrote:
> > > I have an object storing integers, many formulas may of course generate the same integer. And for some expressions for example on form a*x^j i would like to store each occurence. Now all my numbers are printed out in a square grid.
> > >
> > > Right now the storing structure look like this and i set fontcolor and rectangle color as i print out the grid.
> > >
> > > However i would like to store multiple func and rcolors within same object?
> > > Thus make func and rcolor the multidimensional part of the array.
> > >
> > > I am totally clueless for how both initiate and update such an object in javascript. I have managed to do it for numbers but i never initiated the object it was somehow forked in as i updated the object. And i really did not understand how it really worked. So if someone could show me howto make this array of integers to holld multiple functions and rectangles for each arr[i] it would be great.
> > >
> > > function arraysize()
> > > {
> > >
> > > for ( i = - scope; i <= scope; i ++ )
> > > {
> > > arr[i] =
> > > {
> > > count : i,
> > > func : '',
> > > fcolor : 'black',
> > > rheight : 100,
> > > rwidth : 100,
> > > rcolor : 'white',
> > > prime : true,
> > > formula : 0,
> > > sigma : 0,
> > > }
> > > }
> > > }
> > >
> >
> > Sorry but I am drunk lol I wall think for an ann-er in the morning lololol
>
> Lets hope you sobered up...
> var x = new Array(10);
> for (var i = 0; i < 10; i++) {
> x[i] = new Array(20);
> }
> x[5][12] = 3.0;
>
> How does this relate to my example array above?
> I do not know how many occurences there will be, and it is only the func and rcolor property of the object that will be multidimensional.
>
> for ( i = - scope; i <= scope; i ++ )
> {
>
> arr[i] =
> {
> count : i,
> func : '',
> fcolor : 'black',
> rheight : 100,
> rwidth : 100,
> rcolor : 'white',
> prime : true,
> formula : 0,
> sigma : 0,
> }
> arr[i] = new Array(20);//??????????
> }
> }
If i let out 20 above, arr[i] = new Array(); will the subarray dynamically assign memory as i pass new properties?
So to update the object i use arr[x][y].func="mystring" or arr[x][y].rcolor="green".
Is there space allocated for the rest of the attributes/properties of the object?
Does the object creation and the update seem right?
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Layered object jonas.thornvall@gmail.com - 2016-05-21 10:41 -0700
Re: Layered object Aleksandro <aleksandro@gmx.com> - 2016-05-21 19:41 -0400
Re: Layered object jonas.thornvall@gmail.com - 2016-05-21 23:42 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-22 03:50 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-22 09:03 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-22 14:59 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-22 15:57 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-22 22:46 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-25 17:13 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-22 23:05 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-25 17:15 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-22 23:08 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-23 08:31 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-24 05:38 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-25 17:22 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-25 22:56 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-25 23:07 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-25 23:10 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-25 23:24 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-26 01:47 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-26 01:53 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-26 02:58 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-26 06:42 -0700
Re: Layered object Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-26 11:30 +0100
Re: Layered object jonas.thornvall@gmail.com - 2016-05-26 03:47 -0700
Re: Layered object Tim Streater <timstreater@greenbee.net> - 2016-05-26 12:43 +0100
Re: Layered object Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-26 14:13 +0100
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-26 07:05 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-26 03:51 -0700
Re: Layered object jonas.thornvall@gmail.com - 2016-05-26 04:00 -0700
Re: Layered object Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-05-27 22:14 +0100
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-26 06:40 -0700
Re: Layered object "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-05-25 17:21 -0700
csiph-web